diff --git a/BankEconomyMod/src/me/kaZep/Base/Main.java b/BankEconomyMod/src/me/kaZep/Base/Main.java index 9f3a847..ae4216a 100644 --- a/BankEconomyMod/src/me/kaZep/Base/Main.java +++ b/BankEconomyMod/src/me/kaZep/Base/Main.java @@ -2076,9 +2076,18 @@ public void runTick() { } if (nearby.get(i).getType()==EntityType.SKELETON || nearby.get(i).getType()==EntityType.ZOMBIE || - nearby.get(i).getType()==EntityType.SPIDER) { + nearby.get(i).getType()==EntityType.SPIDER|| + nearby.get(i).getType()==EntityType.CREEPER|| + nearby.get(i).getType()==EntityType.ENDERMAN) { LivingEntity l = (LivingEntity)nearby.get(i); - if (l.getKiller()!=null && Math.random()<=0.5/l.getNearbyEntities(10, 10, 10).size()) { + List ents = l.getNearbyEntities(10, 10, 10); + for (int m=0;m lore = p.getEquipment().getHelmet().getItemMeta().getLore(); - for (int i=0;i lore = p.getEquipment().getHelmet().getItemMeta().getLore(); + for (int i=0;i lore = p.getEquipment().getChestplate().getItemMeta().getLore(); - for (int i=0;i lore = p.getEquipment().getChestplate().getItemMeta().getLore(); + for (int i=0;i lore = p.getEquipment().getLeggings().getItemMeta().getLore(); - for (int i=0;i lore = p.getEquipment().getLeggings().getItemMeta().getLore(); + for (int i=0;i lore = p.getEquipment().getBoots().getItemMeta().getLore(); - for (int i=0;i lore = p.getEquipment().getBoots().getItemMeta().getLore(); + for (int i=0;i lore = p.getEquipment().getHelmet().getItemMeta().getLore(); - for (int i=0;i100) { - helm_dura-=1; - } + } + if (p.getEquipment().getHelmet()!=null && helm_dura!=-1 && p.getEquipment().getHelmet().hasItemMeta() && + p.getEquipment().getHelmet().getItemMeta().hasLore()) { + List lore = p.getEquipment().getHelmet().getItemMeta().getLore(); + double dura_numb=0; + for (int i=0;i lore = p.getEquipment().getChestplate().getItemMeta().getLore(); - for (int i=0;i100) { - chest_dura-=1; - } + if (!weak_helm) {dura_numb+=300; /*Bukkit.getLogger().info("1 not weak.");*/} + if (Math.random()*dura_numb>100) { + helm_dura-=1; + } + } + if (p.getEquipment().getChestplate()!=null && chest_dura!=-1 && p.getEquipment().getChestplate().hasItemMeta() && + p.getEquipment().getChestplate().getItemMeta().hasLore()) { + List lore = p.getEquipment().getChestplate().getItemMeta().getLore(); + double dura_numb=0; + for (int i=0;i lore = p.getEquipment().getLeggings().getItemMeta().getLore(); - for (int i=0;i100) { - legs_dura-=1; - } + if (!weak_chest) {dura_numb+=300; /*Bukkit.getLogger().info("2 not weak.");*/} + if (Math.random()*dura_numb>100) { + chest_dura-=1; + } + } + if (p.getEquipment().getLeggings()!=null && legs_dura!=-1 && p.getEquipment().getLeggings().hasItemMeta() && + p.getEquipment().getLeggings().getItemMeta().hasLore()) { + List lore = p.getEquipment().getLeggings().getItemMeta().getLore(); + double dura_numb=0; + for (int i=0;i lore = p.getEquipment().getBoots().getItemMeta().getLore(); - for (int i=0;i100) { - boots_dura-=1; - } + if (!weak_legs) {dura_numb+=300; /*Bukkit.getLogger().info("3 not weak.");*/} + if (Math.random()*dura_numb>100) { + legs_dura-=1; + } + } + if (p.getEquipment().getBoots()!=null && boots_dura!=-1 && p.getEquipment().getBoots().hasItemMeta() && + p.getEquipment().getBoots().getItemMeta().hasLore()) { + List lore = p.getEquipment().getBoots().getItemMeta().getLore(); + double dura_numb=0; + for (int i=0;i100) { + boots_dura-=1; + } } - },1); - } + if (p.getEquipment().getBoots()!=null && boots_dura!=-1) {ItemStack i = p.getEquipment().getBoots(); i.setDurability((short)boots_dura); p.getEquipment().setBoots(i);} + if (p.getEquipment().getLeggings()!=null && legs_dura!=-1) {ItemStack i = p.getEquipment().getLeggings(); i.setDurability((short)legs_dura); p.getEquipment().setLeggings(i);} + if (p.getEquipment().getChestplate()!=null && chest_dura!=-1) {ItemStack i = p.getEquipment().getChestplate(); i.setDurability((short)chest_dura); p.getEquipment().setChestplate(i);} + if (p.getEquipment().getHelmet()!=null && helm_dura!=-1) {ItemStack i = p.getEquipment().getHelmet(); i.setDurability((short)helm_dura); p.getEquipment().setHelmet(i);} + Bukkit.getLogger().info("Durability of items now are: "+helm_dura+","+chest_dura+","+legs_dura+","+boots_dura); + } + },1); } } diff --git a/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java b/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java index c2ada10..f72c743 100644 --- a/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java +++ b/BankEconomyMod/src/me/kaZep/Commands/commandBankEconomy.java @@ -834,6 +834,16 @@ public String convertToItemName(String val) { // Arrows i.setItem(count+=1, new ItemStack(Material.ARROW, 64)); + temp = new ItemStack(Material.getMaterial(34),64); + ItemMeta meta = temp.getItemMeta(); + meta.setDisplayName(ChatColor.LIGHT_PURPLE+"Job Boost Card"); + List lore = new ArrayList(); + lore.add("Use /jobs boost to instantly level up"); + lore.add("that job with this card!"); + meta.setLore(lore); + temp.setItemMeta(meta); + i.setItem(count+=1, temp); + p.openInventory(i);