When I open the GUI minecraft crashes with this:
TileEntityInterChest: https://github.com/megabitus98/Blocks-Items-Revolution/blob/master/src/main/java/com/mega/bir/block/tileentity/TileEntityInterChest.java
GuiInterChest: https://github.com/megabitus98/Blocks-Items-Revolution/blob/master/src/main/java/com/mega/bir/client/interfaces/interchest/GuiInterChest.java
Hi! I've made a custom crafting for my Machine and when I place the items It doesn't craft, I get no error, can you help me?
This is my ContainerMachine:
This is my GuiMachine:
This is my MachineComparator:
This is my MachineCraftingManager:
This is my MachineShapedRecipes:
This my MachineShapelessRecipes:
And here is my Github with the last commit: https://github.com/megabitus98/Blocks-Items-Revolution
I've tried to do like this
@Override
public void onContainerClosed(EntityPlayer entityplayer)
{
super.onContainerClosed(entityplayer);
for(int i = 0; i < TileEntityInterChest.INVENTORY_SIZE; i++)
{
ItemStack itemstack = craftMatrix.getStackInSlot(i);
if(itemstack != null && worldObj.isRemote)
{
entityplayer.entityDropItem(itemstack, 0.05F);
}
}
}
But it crashes now:
And here is my entire class: https://github.com/megabitus98/Blocks-Items-Revolution/blob/master/src/main/java/com/mega/bir/client/interfaces/machine/ContainerMachine.java
Hi! I have a block that when I close the GUI I drop the items that are in slots, they drop but they leave ghost blocks, here is the code:
@Override
public void onContainerClosed(EntityPlayer entityplayer)
{
super.onContainerClosed(entityplayer);
for(int i = 0; i < TileEntityInterChest.INVENTORY_SIZE; i++)
{
ItemStack itemstack = craftMatrix.getStackInSlot(i);
if(itemstack != null)
{
entityplayer.entityDropItem(itemstack, 0.05F);
}
}
}
Can someone help me?
Thanks!
I've done it like this:
@Override
public void onBlockPlacedBy(World world, int par2, int par3, int par4, EntityLivingBase entity, ItemStack itemstack) {
if(entity instanceof EntityPlayer){
EntityPlayer player = (EntityPlayer) entity;
PlayerName = player.getDisplayName();
}
}
Hello! I have a Gui with 2 slots and I want to block one of them so the player can only take items from one and put items in the other, does anybody know how to do this?