Guest User

Untitled

a guest
Jul 4th, 2014
484
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. @Override
  2. public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer player, EntityLivingBase target)
  3. {
  4. if (target instanceof EntityLostSoulMob) {
  5.  
  6. int i = (int)player.posX;
  7. int j = (int)player.posY;
  8. int k = (int)player.posZ;
  9.  
  10. World world = player.worldObj;
  11.  
  12. boolean helmOn = false;
  13. boolean chestOn = false;
  14. boolean legsOn = false;
  15. boolean bootsOn = false;
  16.  
  17. if (player.inventory.armorInventory[0] != null )
  18. if(player.inventory.armorInventory[0] == new ItemStack(SoulCraft.soulHelmet))
  19. helmOn = true;
  20.  
  21. if (player.inventory.armorInventory[1] != null )
  22. if(player.inventory.armorInventory[1] == new ItemStack(SoulCraft.soulChest))
  23. chestOn = true;
  24.  
  25. if (player.inventory.armorInventory[2] != null )
  26. if(player.inventory.armorInventory[2] == new ItemStack(SoulCraft.soulLeggings))
  27. legsOn = true;
  28.  
  29. if (player.inventory.armorInventory[3] != null )
  30. if(player.inventory.armorInventory[3] == new ItemStack(SoulCraft.soulBoots))
  31. bootsOn = true;
  32.  
  33.  
  34. if(helmOn && chestOn && legsOn && bootsOn) {
  35.  
  36. world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
  37.  
  38.  
  39. player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(SoulCraft.soulTrapLostSoul));
  40.  
  41. target.setDead();
  42.  
  43. }
  44.  
  45. else {
  46.  
  47. world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
  48. world.spawnEntityInWorld(new EntityLightningBolt(world, i + 2, j, k));
  49. world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k + 2));
  50. world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k - 2));
  51. world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k - 2));
  52.  
  53. GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
  54. chat.printChatMessage(new ChatComponentText("Fool tried to capture a soul without proper Soul Armor"));
  55.  
  56. }
  57.  
  58. return true;
  59.  
  60. }
  61.  
  62. return false;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment