Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this was me trying to set the items in the tile entity from the stacks nbt
- @Override
- public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer,
- ItemStack stack) {
- super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
- TileEntityICSB te = (TileEntityICSB)worldIn.getTileEntity(pos);
- stackPlacer = te.itemStackHandler;
- NBTTagCompound data = stack.getTagCompound().getTag("items")
- ItemStackHandler handler = new ItemStackHandler(27);
- handler.deserializeNBT(data);
- for(int i = 0; i < 27; i++)
- {
- te.itemStackHandler.setStackInSlot(i, handler.getStackInSlot(i));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement