• 0

    posted a message on Any standalone version of the shaders mod?

    Thanks for the help anyway, I can't use optifine with shaders because it drags down my performance.

    Posted in: Mods Discussion
  • 0

    posted a message on Any standalone version of the shaders mod?

    Karyonix's shaders mod isn't compatible with forge though. I'm looking for something that I can run through forge.

    Posted in: Mods Discussion
  • 0

    posted a message on Any standalone version of the shaders mod?

    I was wondering if anyone knew of a version of the GLSL Shaders mod for 1.10.2 that isn't part of optifine, like a standalone version. It has to be compatible with Forge, as there are other mods I would like to use with it.

    Posted in: Mods Discussion
  • 0

    posted a message on Carbon Client 1.0

    What mc version are you using?

    Posted in: Modification Development
  • 0

    posted a message on 1.10.2 Forge Mod Help with container

    I'm making a forge mod for MC 1.10.2 and I'm having problems with a container. When I execute the code setInventorySlotContents(), it puts the item in the specified slot, but when I try to take the item out of the slot, it just dissapears. Executing decrStackSize() does nothing.


    Heres my TileEntity code implementing IInventory (Note there are unfinished features)

    package net.makan.blocks.tech.tileentity;
    
    import net.makan.data.ItemData;
    import net.makan.gui.assembler.ContainerAssembler;
    import net.makan.items.basic.ItemBlueprint;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.EntityPlayerMP;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.inventory.ItemStackHelper;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.nbt.NBTTagList;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.util.ITickable;
    
    public class TileEntityAssembler extends TileEntity implements IInventory, ITickable {
    	private ItemStack[] inventory;
    	private String customName;
    	public int fabricateTimer = 60;
    	public ContainerAssembler c;
    
    	public TileEntityAssembler() {
    		this.inventory = new ItemStack[this.getSizeInventory()];
    		this.c = new ContainerAssembler(this, this);
    	}
    
    	@Override
    	public NBTTagCompound writeToNBT(NBTTagCompound nbt) {
    		super.writeToNBT(nbt);
    
    		NBTTagList list = new NBTTagList();
    		for (int i = 0; i < this.getSizeInventory(); ++i) {
    			if (this.getStackInSlot(i) != null) {
    				NBTTagCompound stackTag = new NBTTagCompound();
    				stackTag.setByte("Slot", (byte) i);
    				this.getStackInSlot(i).writeToNBT(stackTag);
    				list.appendTag(stackTag);
    			}
    		}
    		nbt.setTag("Items", list);
    
    		if (this.hasCustomName()) {
    			nbt.setString("CustomName", this.getCustomName());
    		}
    		nbt.setInteger("Timer", this.fabricateTimer);
    		return nbt;
    	}
    
    	@Override
    	public void readFromNBT(NBTTagCompound nbt) {
    		super.readFromNBT(nbt);
    
    		NBTTagList list = nbt.getTagList("Items", 10);
    		for (int i = 0; i < list.tagCount(); ++i) {
    			NBTTagCompound stackTag = list.getCompoundTagAt(i);
    			int slot = stackTag.getByte("Slot") & 255;
    			this.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(stackTag));
    		}
    
    		if (nbt.hasKey("CustomName", 8)) {
    			this.setCustomName(nbt.getString("CustomName"));
    		}
    	}
    
    	public String getCustomName() {
    		return this.customName;
    	}
    
    	public void setCustomName(String customName) {
    		this.customName = customName;
    	}
    
    	@Override
    	public String getName() {
    		return this.hasCustomName() ? this.customName : "container.assembler";
    	}
    
    	@Override
    	public boolean hasCustomName() {
    		return this.customName != null && !this.customName.equals("");
    	}
    
    	@Override
    	public int getSizeInventory() {
    		return 6;
    	}
    
    	@Override
    	public ItemStack getStackInSlot(int index) {
    		if (index < 0 || index >= this.getSizeInventory())
    			return null;
    		return this.inventory[index];
    	}
    
    	@Override
    	public ItemStack decrStackSize(int index, int count) {
    		return ItemStackHelper.getAndSplit(this.inventory, index, count);
    	}
    
    	@Override
    	public ItemStack removeStackFromSlot(int index) {
    		return ItemStackHelper.getAndRemove(this.inventory, index);
    	}
    
    	@Override
    	public void setInventorySlotContents(int index, ItemStack stack) {
    		boolean flag = stack != null && stack.isItemEqual(this.inventory[index])
    				&& ItemStack.areItemStackTagsEqual(stack, this.inventory[index]);
    		this.inventory[index] = stack;
    
    		if (stack != null && stack.stackSize > this.getInventoryStackLimit()) {
    			stack.stackSize = this.getInventoryStackLimit();
    		}
    
    		if (index == 0 && !flag) {
    			this.markDirty();
    		}
    	}
    
    	@Override
    	public int getInventoryStackLimit() {
    		return 64;
    	}
    
    	@Override
    	public boolean isUseableByPlayer(EntityPlayer player) {
    		return this.worldObj.getTileEntity(this.getPos()) == this
    				&& player.getDistanceSq(this.pos.add(0.5, 0.5, 0.5)) <= 64;
    	}
    
    	@Override
    	public void openInventory(EntityPlayer player) {
    
    	}
    
    	@Override
    	public void closeInventory(EntityPlayer player) {
    
    	}
    
    	@Override
    	public boolean isItemValidForSlot(int index, ItemStack stack) {
    		return true;
    	}
    
    	@Override
    	public int getField(int id) {
    		return 0;
    	}
    
    	@Override
    	public void setField(int id, int value) {
    
    	}
    
    	@Override
    	public int getFieldCount() {
    		return 4;
    	}
    
    	@Override
    	public void clear() {
    		for (int i = 0; i < this.getSizeInventory(); i++) {
    			this.setInventorySlotContents(i, null);
    		}
    	}
    
    	public void fabricate() {
    		if (this.getStackInSlot(4) != null) {
    			if (this.getStackInSlot(4).getItem() instanceof ItemBlueprint) {
    				if (this.fabricateTimer >= 60) {
    					this.fabricateTimer = 0;
    					Item i = this.getStackInSlot(4).getItem();
    					ItemBlueprint item = (ItemBlueprint) i;
    					for (int slot = 0; slot < 3; slot++) {
    						if (this.getStackInSlot(slot) != null) {
    							if (this.getStackInSlot(slot).stackSize >= item.reqFor
    									&& this.getStackInSlot(slot).stackSize >= item.reqInorg
    									&& this.getStackInSlot(slot).stackSize >= item.reqOre
    									&& this.getStackInSlot(slot).stackSize >= item.reqOrg) {
    								if (this.getStackInSlot(slot) == new ItemStack(ItemData.ForeignMaterial)
    										&& item.reqFor > 0) {
    									if (!this.getWorld().isRemote) {
    										this.decrStackSize(slot, item.reqFor);
    									}
    								}
    								if (this.getStackInSlot(slot) == new ItemStack(ItemData.InorganicMaterial)
    										&& item.reqInorg > 0) {
    									this.decrStackSize(slot, item.reqInorg);
    								}
    								if (this.getStackInSlot(slot) == new ItemStack(ItemData.OreMaterial)
    										&& item.reqOrg > 0) {
    									this.decrStackSize(slot, item.reqOre);
    								}
    								if (this.getStackInSlot(slot) == new ItemStack(ItemData.OrganicMaterial)
    										&& item.reqOre > 0) {
    									this.decrStackSize(slot, item.reqOrg);
    								}
    								this.setInventorySlotContents(5, new ItemStack(ItemData.Nullifier, 1));
    							}
    						}
    					}
    				}
    			}
    		}
    	}
    
    	@Override
    	public void update() {
    		if (this.fabricateTimer <= 60) {
    			this.fabricateTimer += 1;
    		}
    	}
    
    }


    And my container class

    package net.makan.gui.assembler;
    
    import net.makan.blocks.tech.tileentity.TileEntityAssembler;
    import net.makan.gui.ancientstone.ContainerAncientStone;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.inventory.Container;
    import net.minecraft.inventory.ContainerFurnace;
    import net.minecraft.inventory.IContainerListener;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.inventory.Slot;
    import net.minecraft.item.ItemStack;
    import net.minecraft.item.crafting.FurnaceRecipes;
    import net.minecraft.tileentity.TileEntityFurnace;
    import net.minecraftforge.items.ItemHandlerHelper;
    
    public class ContainerAssembler extends Container {
    
     private TileEntityAssembler te;
     private IInventory inv;
    
     public ContainerAssembler(IInventory playerInv, TileEntityAssembler assemblerInv) {
     this.te = assemblerInv;
    
     // Material Slots
     this.addSlotToContainer(new SlotMaterial(assemblerInv, 0, 31, 21));
     this.addSlotToContainer(new SlotMaterial(assemblerInv, 1, 49, 21));
     this.addSlotToContainer(new SlotMaterial(assemblerInv, 2, 31, 39));
     this.addSlotToContainer(new SlotMaterial(assemblerInv, 3, 49, 39));
    
     // Blueprint Slot
     this.addSlotToContainer(new SlotBlueprint(assemblerInv, 4, 71, 31));
    
     // Output Slot
     this.addSlotToContainer(new SlotAssemblerOutput(assemblerInv, 5, 125, 32));
    
     // Player Inventory Slots
     for (int y = 0; y < 3; ++y) {
     for (int x = 0; x < 9; ++x) {
     this.addSlotToContainer(new Slot(playerInv, x + y * 9 + 9, 8 + x * 18, 84 + y * 18));
     }
     }
    
     for (int x = 0; x < 9; ++x) {
     this.addSlotToContainer(new Slot(playerInv, x, 8 + x * 18, 142));
     }
     }
    
     @Override
     public boolean canInteractWith(EntityPlayer playerIn) {
     return true;
     }
    
     @Override
     public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) {
     ItemStack itemstack = null;
     Slot slot = (Slot)this.inventorySlots.get(index);
    
     if (slot != null && slot.getHasStack())
     {
     ItemStack itemstack1 = slot.getStack();
     itemstack = itemstack1.copy();
    
     if (index == 2)
     {
     if (!this.mergeItemStack(itemstack1, 3, 39, true))
     {
     return null;
     }
    
     slot.onSlotChange(itemstack1, itemstack);
     }
     else if (index != 1 && index != 0)
     {
     if (FurnaceRecipes.instance().getSmeltingResult(itemstack1) != null)
     {
     if (!this.mergeItemStack(itemstack1, 0, 1, false))
     {
     return null;
     }
     }
     else if (TileEntityFurnace.isItemFuel(itemstack1))
     {
     if (!this.mergeItemStack(itemstack1, 1, 2, false))
     {
     return null;
     }
     }
     else if (index >= 3 && index < 30)
     {
     if (!this.mergeItemStack(itemstack1, 30, 39, false))
     {
     return null;
     }
     }
     else if (index >= 30 && index < 39 && !this.mergeItemStack(itemstack1, 3, 30, false))
     {
     return null;
     }
     }
     else if (!this.mergeItemStack(itemstack1, 3, 39, false))
     {
     return null;
     }
    
     if (itemstack1.stackSize == 0)
     {
     slot.putStack((ItemStack)null);
     }
     else
     {
     slot.onSlotChanged();
     }
    
     if (itemstack1.stackSize == itemstack.stackSize)
     {
     return null;
     }
    
     slot.onPickupFromSlot(playerIn, itemstack1);
     }
    
     return itemstack;
     }
    
     @Override
     protected boolean mergeItemStack(ItemStack stack, int startIndex, int endIndex, boolean useEndIndex) {
     super.mergeItemStack(stack, startIndex, endIndex, useEndIndex);
     boolean success = false;
     int index = startIndex;
    
     if (useEndIndex)
     index = endIndex - 1;
    
     Slot slot;
     ItemStack stackinslot;
    
     if (stack.isStackable()) {
     while (stack.stackSize > 0 && (!useEndIndex && index < endIndex || useEndIndex && index >= startIndex)) {
     slot = (Slot) this.inventorySlots.get(index);
     stackinslot = slot.getStack();
    
     if (stackinslot != null && stackinslot.getItem() == stack.getItem()
     && (!stack.getHasSubtypes() || stack.getMetadata() == stackinslot.getMetadata())
     && ItemStack.areItemStackTagsEqual(stack, stackinslot)) {
     int l = stackinslot.stackSize + stack.stackSize;
     int maxsize = Math.min(stack.getMaxStackSize(), slot.getItemStackLimit(stack));
    
     if (l <= maxsize) {
     stack.stackSize = 0;
     stackinslot.stackSize = l;
     slot.onSlotChanged();
     success = true;
     } else if (stackinslot.stackSize < maxsize) {
     stack.stackSize -= stack.getMaxStackSize() - stackinslot.stackSize;
     stackinslot.stackSize = stack.getMaxStackSize();
     slot.onSlotChanged();
     success = true;
     }
     }
    
     if (useEndIndex) {
     --index;
     } else {
     ++index;
     }
     }
     }
    
     if (stack.stackSize > 0) {
     if (useEndIndex) {
     index = endIndex - 1;
     } else {
     index = startIndex;
     }
    
     while (!useEndIndex && index < endIndex || useEndIndex && index >= startIndex && stack.stackSize > 0) {
     slot = (Slot) this.inventorySlots.get(index);
     stackinslot = slot.getStack();
    
     if (stackinslot == null && slot.isItemValid(stack)) {
     if (stack.stackSize < slot.getItemStackLimit(stack)) {
     slot.putStack(stack.copy());
     stack.stackSize = 0;
     success = true;
     break;
     } else {
     ItemStack newstack = stack.copy();
     newstack.stackSize = slot.getItemStackLimit(stack);
     slot.putStack(newstack);
     stack.stackSize -= slot.getItemStackLimit(stack);
     success = true;
     }
     }
    
     if (useEndIndex) {
     --index;
     } else {
     ++index;
     }
     }
     }
    
     return success;
     }
     
     public void addListener(IContainerListener listener) {
     super.addListener(listener);
     listener.sendAllWindowProperties(this, this.te);
     }
     
     @Override
     public void detectAndSendChanges() {
     super.detectAndSendChanges();
     }
    
    }


    Any ideas on how to fix this?

    Posted in: Modification Development
  • 0

    posted a message on Any way to override IAttributes?

    Never mind, I figured out how to override attributes.

    Posted in: Modification Development
  • 0

    posted a message on Any way to override IAttributes?

    I was wondering if there was a way to override the maximum value of an already existing RangedAttribute (specifically MAX_HEALTH), to raise the value to anything over 1024.

    Posted in: Modification Development
  • 0

    posted a message on How Many Worlds Do You Have?

    I have 437 worlds as of now. I tend to forget things and never delete.

    Posted in: Discussion
  • 0

    posted a message on How do you properly port Minecraft PC maps to MCPE in MCEDIT?

    When I try porting a pc map to mcpe, the chunks get corrupted. Is there any fix to this?


    Correct one on pc (Left)

    Corruption on mcpe (Right)

    Posted in: MCPE: Map Help & Requests
  • 0

    posted a message on 1.12 - How do I use /testforblock to test for items in chests

    Even changing it to "0b" the output doesn't change anything. Filling the chest with the item still leaves the output:

    [17:12:59] The block at -11, 14, -58 did not have the required NBT keys

    Is there a problem with the id?

    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on 1.12 - How do I use /testforblock to test for items in chests

    I'm using 1.12 and I wanted to know how to use /testforblock to test for items in chests, I've tried the following but it doesn't work:

    testforblock -11 14 -58 minecraft:chest 3 {Items:[{id:nether_star,Count:1b,Slot:1b,Damage:0s}]}
    Posted in: Commands, Command Blocks and Functions
  • 0

    posted a message on Minecart Enderchest

    Although this may be a dead thread I would like to comment anyway. A minecart enderchest wouldn't have much of a purpose because the enderchest already transports items with no railway needed. Thus enderchests can only be accessed by the player who placed them, meaning that they would only transport items for one player, making them bad for multiple players to transport items to each other. However these could be used to transport using less rail systems due to their nature.


    Again this is an old thread but, shulker boxes are the alternative for this, as they can be placed in minecart chests and can hold 27 stacks of items. In a minecart that's 27x27 which is 729 slots for items. Overall I think that that might have possibly been useful back then, but has better alternatives now.

    Posted in: Requests / Ideas For Mods
  • 0

    posted a message on Ender Chest Channels Idea

    When you name an ender chest in an anvil, it should be its own ender chest instead of being connected to the rest. It would connect to all ender chests of the same name. This way, you could sort what gets transported where.

    Posted in: Suggestions
  • To post a comment, please or register a new account.