Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

grossik

Members
  • Joined

  • Last visited

Everything posted by grossik

  1. I already solved it, in Entity I had @SideOnly(Side.CLIENT)
  2. @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.
  3. 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); } }
  4. Sorry. This code doesn't work. public boolean Check(){ if(panItemStacks[2].getItem() == ItemHandler.Pancakes) { return true; } return false; }
  5. public boolean Check(){ if(panItemStacks[2].getItem() == ItemHandler.Pancakes) { return true; } return false; } Tento kód nefunguje.
  6. The error is in the Check(). Minecraft always crash.
  7. I have problem with render Pancakes. This code reports an error on if(furnaceItemStacks[2].getItem() == ItemHandler.Pancakes)
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. Perhaps this you wonder from ItemHandler.
  13. I saved everything you need, I just need to save item whether it is in the pan or not.
  14. What? Sorry my English is bad.
  15. Whenever I connect to the world, my item in my pan disappear. Block: TileEntity: Model: Render:
  16. 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.
  17. I use this code?
  18. 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); } }
  19. Anyway, it still destroys farmland when there is water.
  20. 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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.