Fix Ranged Weapons so they only have their bonuses applied when using

their ranged properties. (Such as only when you shoot arrows with bows)
anvil_rework
sigonasr2 11 years ago
parent 35dc7b9bf6
commit 2babc66a85
  1. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class
  2. 4
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java

@ -5955,7 +5955,7 @@ public ItemStack getGoodie() {
//p.sendMessage("No Damage Ticks: "+f.getNoDamageTicks());
ItemStack item = p.getItemInHand();
double critical_chance=0,armor_pen=0,life_steal=0,attack_speed=0,dmg=0;
if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) {
if (item.getType()!=Material.BOW && item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) { //Make sure this isn't a ranged weapon.
for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Critical Chance")) {
critical_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
@ -6106,7 +6106,7 @@ public ItemStack getGoodie() {
p.getScoreboard().getTeam(p.getName()).setSuffix(healthbar(p.getHealth(),p.getMaxHealth()));
ItemStack item = p.getItemInHand();
double critical_chance=0,armor_pen=0,life_steal=0,attack_speed=0,dmg=0;
if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) {
if (item.getType()==Material.BOW && item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) { //Make sure we are using a ranged weapon.
for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Critical Chance")) {
critical_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));

Loading…
Cancel
Save