Everything posted by grossik
-
[1.10.2] Spawn entity on server
I already solved it, in Entity I had @SideOnly(Side.CLIENT)
-
[1.10.2] Spawn entity on server
@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.
-
[1.10.2] Spawn entity on server
It didn't help.
-
[1.10.2] Spawn entity on server
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
I've solved it. Thanks all.
-
[SOLVED] [1.10.2] Problem with saving items in my pan
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
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
The error is in the Check(). Minecraft always crash.
-
[SOLVED] [1.10.2] Problem with saving items in my pan
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
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
What? Probably no.
-
[SOLVED] [1.10.2] Problem with saving items in my pan
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
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
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
Perhaps this you wonder from ItemHandler.
-
[SOLVED] [1.10.2] Problem with saving items in my pan
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
What? Sorry my English is bad.
-
[SOLVED] [1.10.2] Problem with saving items in my pan
How, when there not slot?
-
[SOLVED] [1.10.2] Problem with saving items in my pan
Whenever I connect to the world, my item in my pan disappear. Block: TileEntity: Model: Render:
-
[1.10.2] Destroy only crops.
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.
-
[1.10.2] Destroy only crops.
I use this code?
-
[1.10.2] Destroy only crops.
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); } }
-
[1.10.2] Destroy only crops.
Anyway, it still destroys farmland when there is water.
-
[1.10.2] Destroy only crops.
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.
-
[1.10.2] How load .obj file for mob?
Nobody help?
IPS spam blocked by CleanTalk.