Jump to content

Riss_Crew

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by Riss_Crew

  1. Maybe try to create an Inventory from an ItemStackHandler using the Capability Item Handler If you dont know how to use them, here are few lines for you private ItemStackHandler inventory = new ItemStackHandler(size); // Create the inventory // In your writeToNBT compound.setTag("inventory", inventory.serializeNBT()); //In your readToNBT inventory.deserializeNBT(compound.getCompoundTag("inventory")); //Use capabilities @Override public boolean hasCapability(Capability<?> capability, @Nullable EnumFacing facing) { if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return true; return super.hasCapability(capability,facing); } @Nullable @Override public <T> T getCapability(Capability<T> capability, @Nullable EnumFacing facing) { if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return (T)inventory; return super.getCapability(capability, facing); }
  2. I finally found where the problem come from ! On my GUIHandler, (TileEntityMachineBase)world.getTileEntity(new BlockPos(x,y,z)) is null So i have to fix the creation of the TileEntity
  3. I don't usually use debugger so did I did it correctly ? If yes so the problem is that tileentity is null but how can i fix that ? Here's my tile code in case : https://pastebin.com/w0YGn05K
  4. I replaced all my IInventory by IItemhandler But the error look like the same as before a null slot: https://pastebin.com/bdgUteFt But in my TileEntityClass, my inventory stack look like this : private NonNullList<ItemStack> machineItemStacks = NonNullList.withSize(4, ItemStack.EMPTY); And i have only 4 slots : this.addSlotToContainer(new SlotItemHandler(tileentity, 0, 14, 8)); this.addSlotToContainer(new SlotItemHandler(tileentity, 1, 51, 8)); this.addSlotToContainer(new SlotEnergyFuel(tileentity, 2, 14, 56)); this.addSlotToContainer(new SlotMachineOutput(player.player, tileentity, 3, 114, 7)); So all slots are fill with ItemStack.Empty and are not null no ?
  5. Hello, I have a problem on my code : When i want to open the inventory of my machine, my game crash and here is what the crash report says : https://pastebin.com/LCm2HFEH It seems that the slots on my container is crashing my game. Here's my container code : https://pastebin.com/QVwF0Q74 In case of here are the slots i'm using : https://pastebin.com/h8uNH1gR https://pastebin.com/TNMZ5785 I'm using forge 1.12.2-14.23.4.2703 ~ Latest Thank you for reading, Have a nice day
  6. @Terrails Thanks you a lot ! I added this to my ClientSide @Override public boolean isOpaqueCube(IBlockState state) { return false; } And now it works correctly
  7. Hi @jabelar thank you for your reply. I've updated the links they works correctly now. I've tried to override the @SideOnly but it change nothing
  8. Hello, I was creating a variant of the slime block in my mod and my code and files looks like this Forge Version : Latest/1.12.2-14.23.4.2703 Block code : https://pastebin.com/gcw1rJ7F (Block Material is Clay) Blockstate : { "variants": { "normal":{"model":"slimemod:bloody_slime_block"} } } Model : https://pastebin.com/6Cw7u8Zj Texture in attachment. And when im placing the block on my world this happen : http://prntscr.com/jq2no1 http://prntscr.com/jq2nu9 In all directions of the block (Top, Bottom, N, S,E,W) it shows air. It want to show the texture of the block behind but find nothing to show maybe ? Thank you for reading and have a nice day/night (Sorry if my english sucks :c ).
  9. Hi, I'm having trouble while coding my mod. My lang file won't working with my creative tab. Here goes some screens preInit code : http://prntscr.com/htf0kq CreativeTab class : http://prntscr.com/htf0o3 Directory of my lang file : http://prntscr.com/htf0qn lang content : http://prntscr.com/htf0z4 IG screen : http://prntscr.com/htf1i6 Have a nice day
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.