Guest User

Untitled

a guest
Jul 4th, 2014
939
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. public boolean itemInteractionForEntity(ItemStack itemStack, EntityPlayer player, EntityLivingBase target)
  2. {
  3. if (target instanceof EntityLostSoulMob) {
  4.  
  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.getCurrentArmor(0) != null ){
  18.  
  19. ItemStack boots = player.getCurrentArmor(0);
  20. if(boots.getItem() == SoulCraft.soulBoots) bootsOn = true;
  21.  
  22. }
  23.  
  24. if(player.getCurrentArmor(1) != null ){
  25.  
  26. ItemStack legs = player.getCurrentArmor(1);
  27. if(legs.getItem() == SoulCraft.soulLeggings) legsOn = true;
  28.  
  29. }
  30.  
  31. if(player.getCurrentArmor(2) != null ){
  32.  
  33. ItemStack chest = player.getCurrentArmor(2);
  34. if(chest.getItem() == SoulCraft.soulChest) chestOn = true;
  35.  
  36. }
  37.  
  38. if(player.getCurrentArmor(3) != null ){
  39.  
  40. ItemStack helm = player.getCurrentArmor(3);
  41. if(helm.getItem() == SoulCraft.soulHelmet) helmOn = true;
  42.  
  43. }
  44.  
  45.  
  46. if(helmOn && chestOn && legsOn && bootsOn) {
  47.  
  48. world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
  49.  
  50. player.inventory.setInventorySlotContents(player.inventory.currentItem, new ItemStack(SoulCraft.soulTrapLostSoul));
  51.  
  52. target.setDead();
  53.  
  54. }
  55.  
  56. else {
  57.  
  58. world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k));
  59. world.spawnEntityInWorld(new EntityLightningBolt(world, i + 2, j, k));
  60. world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k + 2));
  61. world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k - 2));
  62. world.spawnEntityInWorld(new EntityLightningBolt(world, i, j, k - 2));
  63.  
  64. GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI();
  65. chat.printChatMessage(new ChatComponentText("Fool tried to capture a soul without proper Soul Armor"));
  66.  
  67. }
  68.  
  69. return true;
  70.  
  71. }
  72.  
  73. return false;
  74. }
Advertisement
Add Comment
Please, Sign In to add comment