
grossik
Members-
Posts
88 -
Joined
-
Last visited
Everything posted by grossik
-
I already solved it, in Entity I had @SideOnly(Side.CLIENT)
-
@Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { if (!playerIn.capabilities.isCreativeMode) { --itemStackIn.stackSize; } if (!worldIn.isRemote) { EntityTractor Tractor = new EntityTractor(worldIn); Tractor.setPosition(playerIn.posX, playerIn.posY, playerIn.posZ); worldIn.spawnEntityInWorld(Tractor); } playerIn.addStat(StatList.getObjectUseStats(this)); return new ActionResult(EnumActionResult.SUCCESS, itemStackIn); } Still the same error.
-
It didn't help.
-
I have problem with my entity spawn on server. Item right click: @Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { if (!worldIn.isRemote) { EntityTractor entity = new EntityTractor(worldIn); entity.setPosition(playerIn.posX, playerIn.posY, playerIn.posZ); worldIn.spawnEntityInWorld(entity); --itemStackIn.stackSize; return new ActionResult(EnumActionResult.SUCCESS, itemStackIn); } else { return new ActionResult(EnumActionResult.PASS, itemStackIn); } }
-
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
I've solved it. Thanks all. -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
Sorry. This code doesn't work. public boolean Check(){ if(panItemStacks[2].getItem() == ItemHandler.Pancakes) { return true; } return false; } -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
public boolean Check(){ if(panItemStacks[2].getItem() == ItemHandler.Pancakes) { return true; } return false; } Tento kód nefunguje. -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
The error is in the Check(). Minecraft always crash. -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
I have problem with render Pancakes. This code reports an error on if(furnaceItemStacks[2].getItem() == ItemHandler.Pancakes) -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
I figured it out myself. public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { TileEntityPan te = (TileEntityPan) world.getTileEntity(pos); Container container = te.createContainer(player.inventory, player); Slot slot = (Slot)container.inventorySlots.get(0); if(!world.isRemote){ if(heldItem != null && heldItem.getItem().equals(ItemHandler.DfPancakes) && !te.isBurning()) { ItemStack is = heldItem.splitStack(1); slot.putStack(is); } else{ player.openGui(Main.MODID, FC2_GuiHandler.PANGUI, world, pos.getX(), pos.getY(), pos.getZ()); } } return true; } Thanks. But I have a problem with the render pancakes. -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
What? Probably no. -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { TileEntityPan te = (TileEntityPan) world.getTileEntity(pos); Container container = te.createContainer(player.inventory, player); Slot slot = (Slot)container.inventorySlots.get(0); if(!world.isRemote){ if(heldItem != null && heldItem.getItem().equals(ItemHandler.DfPancakes) && !te.isBurning()) { slot.putStack(heldItem); heldItem.stackSize--; } else{ player.openGui(Main.MODID, FC2_GuiHandler.PANGUI, world, pos.getX(), pos.getY(), pos.getZ()); } } return true; } But slot.putStack(heldItem); give me whole stack. But I only want one item, no stack. -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { TileEntityPan te = (TileEntityPan) world.getTileEntity(pos); if(!world.isRemote){ if(heldItem != null && heldItem.getItem().equals(ItemHandler.DfPancakes) && !te.isBurning()) { heldItem.stackSize--; } else{ player.openGui(Main.MODID, FC2_GuiHandler.PANGUI, world, pos.getX(), pos.getY(), pos.getZ()); } } return true; } And now I'm finished. I do not know how to put the item into the slot. -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
Yeah, I know it, too. But I do not know how to do that when you click on item with an item, the item is put into the slot. -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
Perhaps this you wonder from ItemHandler. -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
I saved everything you need, I just need to save item whether it is in the pan or not. -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
What? Sorry my English is bad. -
[SOLVED] [1.10.2] Problem with saving items in my pan
grossik replied to grossik's topic in Modder Support
How, when there not slot? -
Whenever I connect to the world, my item in my pan disappear. Block: TileEntity: Model: Render:
-
This code works perfectly. int i = MathHelper.floor_double(this.posX); int j = MathHelper.floor_double(this.posY); int k = MathHelper.floor_double(this.posZ); for (int l = 0; l < 4; ++l) { i = MathHelper.floor_double(this.posX + (double)((float)(l % 2 * 2 - 1) * 0.25F)); j = MathHelper.floor_double(this.posY); k = MathHelper.floor_double(this.posZ + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F)); BlockPos blockpos = new BlockPos(i, j, k); IBlockState iblockstate = this.worldObj.getBlockState(blockpos); Block block = worldObj.getBlockState(blockpos).getBlock(); if(block instanceof BlockCrops){ this.worldObj.destroyBlock(blockpos, true); } } Thanks.
-
I use this code?
-
int i = MathHelper.floor_double(this.posX); int j = MathHelper.floor_double(this.posY); int k = MathHelper.floor_double(this.posZ); for (int l = 0; l < 4; ++l) { i = MathHelper.floor_double(this.posX + (double)((float)(l % 2 * 2 - 1) * 0.25F)); j = MathHelper.floor_double(this.posY); k = MathHelper.floor_double(this.posZ + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F)); BlockPos blockpos = new BlockPos(i, j, k); IBlockState iblockstate = this.worldObj.getBlockState(blockpos); if (iblockstate.getBlock() == Blocks.CARROTS); { this.worldObj.destroyBlock(blockpos, true); } }
-
Anyway, it still destroys farmland when there is water.
-
As only destroy crops? This code: int i = MathHelper.floor_double(this.posX); int j = MathHelper.floor_double(this.posY); int k = MathHelper.floor_double(this.posZ); for (int l = 0; l < 4; ++l) { i = MathHelper.floor_double(this.posX + (double)((float)(l % 2 * 2 - 1) * 0.25F)); j = MathHelper.floor_double(this.posY); k = MathHelper.floor_double(this.posZ + (double)((float)(l / 2 % 2 * 2 - 1) * 0.25F)); BlockPos blockpos = new BlockPos(i, j, k); Class block = BlockCrops.class; IBlockState iblockstate = this.worldObj.getBlockState(blockpos); if (iblockstate.getClass() == block); { this.worldObj.destroyBlock(blockpos, true); } } Destroys farmland and water.
-
Nobody help?