Jump to content

BeefEX

Members
  • Posts

    8
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

BeefEX's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Hi, is there a way to get recipe of certain ItemStack? I tried messing with Crafting Manager with no success? Can somebody point me the correct way? Thanks ~BeefEX
  2. Hi, is there a way to get recipe of certain ItemStack? I tried messing with Crafting Manager with no success? Can somebody point me the correct way? Thanks ~BeefEX
  3. So do i have to use that plugin? I dont quite understand how to use it .
  4. Hi, i added my library that i want to use to my libs folder. I can use them i code, minecraft runs ok. But when i build the mod and try to launch it says that classes from that library are missing. I have tried adding that library to my build.gradle as dependenci but that did not work. Any ideas? Thanks ~BeefEX
  5. I tried adding world.isRemote to this if if (tileEntity == null) { return false; } and it simply does nothing. That method is not executed on server side.
  6. I think i do becose i am summoning item but it is just ghost item. @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int metadata, float what, float these, float are) { if (cooldown > 0) { return false; } TileEntityInfuser tileEntity = (TileEntityInfuser)world.getTileEntity(x, y, z); if (tileEntity == null) { return false; } ItemStack heldItem = player.inventory.getCurrentItem(); if (heldItem == null) { if (player.isSneaking()) { ChatUtils.newChatMessage(player, "Stored NatureFlux: " + String.valueOf(storedNF)); } else if (!player.isSneaking() && tileEntity.getStackInSlot(0) != (ItemStack)null) { ItemStack item = tileEntity.getStackInSlot(0); float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy()); } float factor = 0.05F; entityItem.motionX = rand.nextGaussian() * factor; entityItem.motionY = rand.nextGaussian() * factor + 0.2F; entityItem.motionZ = rand.nextGaussian() * factor; world.spawnEntityInWorld(entityItem); tileEntity.setInventorySlotContents(0, (ItemStack)null); } } else { if (player.isSneaking() && heldItem.getItem().getUnlocalizedName() == NFItems.transmutator.getUnlocalizedName()) { //Playrutils.removeItem(player, heldItem); tileEntity.setInventorySlotContents(0, heldItem); player.inventory.decrStackSize(player.inventory.currentItem, 64); //player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); } else if (!player.isSneaking() && tileEntity.getStackInSlot(0) != (ItemStack)null) { ItemStack item = tileEntity.getStackInSlot(0); System.out.println(item.getItem().getUnlocalizedName(item)); float rx = rand.nextFloat() * 0.8F + 0.1F; float ry = rand.nextFloat() * 0.8F + 0.1F; float rz = rand.nextFloat() * 0.8F + 0.1F; EntityItem entityItem = new EntityItem(world, x + rx, y + ry, z + rz, new ItemStack(item.getItem(), item.stackSize, item.getItemDamage())); if (item.hasTagCompound()) { entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy()); } float factor = 0.05F; entityItem.motionX = rand.nextGaussian() * factor; entityItem.motionY = rand.nextGaussian() * factor + 0.2F; entityItem.motionZ = rand.nextGaussian() * factor; world.spawnEntityInWorld(entityItem); //tileEntity.setInventorySlotContents(0, (ItemStack)null); } } cooldown = 10; return true; }
  7. Hi, when i use this player.inventory.decrStackSize(player.inventory.currentItem, 64); or this player.inventory.setInventorySlotContents(player.inventory.currentItem, (ItemStack)null); to remove Item from players inventory it comes back in any ideas?
×
×
  • Create New...

Important Information

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