Funnygatt

Untitled

Dec 7th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.52 KB | None | 0 0
  1. protected void execute(Event event) {
  2.         Player client = this.playerToSee.getSingle(event);
  3.         LivingEntity[] targetEntity = (LivingEntity[]) this.targetEntity.getAll(event);
  4.         ItemStack item = this.item.getSingle(event);
  5.         String slottoget = this.slot.getSingle(event);
  6.  
  7.         FakeEquipment.EquipmentSlot finalslot = getSlot(slottoget);
  8.         for (LivingEntity le : targetEntity){
  9.             FakeEquipment.EquipmentSendingEvent newevent = new FakeEquipment.EquipmentSendingEvent(client, le, finalslot, item);
  10.             Bukkit.getPluginManager().callEvent(event);
  11.         }
  12.  
  13.     }
  14.     public FakeEquipment.EquipmentSlot getSlot(String slottoget){
  15.         if (slottoget.equalsIgnoreCase("HEAD") || slottoget.equalsIgnoreCase("HELM") || slottoget.equalsIgnoreCase("HELMET")) {
  16.             return FakeEquipment.EquipmentSlot.HELMET;
  17.         }
  18.         if (slottoget.equalsIgnoreCase("CHEST") || slottoget.equalsIgnoreCase("CHESTPLATE") || slottoget.equalsIgnoreCase("BODY")) {
  19.             return FakeEquipment.EquipmentSlot.CHESTPLATE;
  20.         }
  21.         if (slottoget.equalsIgnoreCase("PANTS") || slottoget.equalsIgnoreCase("LEGS") || slottoget.equalsIgnoreCase("LEGGINGS")) {
  22.             return FakeEquipment.EquipmentSlot.LEGGINGS;
  23.         }
  24.         if (slottoget.equalsIgnoreCase("BOOTS") || slottoget.equalsIgnoreCase("FEET") || slottoget.equalsIgnoreCase("SHOES")) {
  25.             return FakeEquipment.EquipmentSlot.BOOTS;
  26.         }
  27.         if (slottoget.equalsIgnoreCase("HELD") || slottoget.equalsIgnoreCase("TOOL") || slottoget.equalsIgnoreCase("WEAPON")) {
  28.             return FakeEquipment.EquipmentSlot.HELD;
  29.         }
  30.         return FakeEquipment.EquipmentSlot.HELMET;
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment