Change bonus enchantment applied percentages from being additive to

multiplicative.
anvil_rework
sigonasr2 11 years ago
parent 2babc66a85
commit 124ec993ea
  1. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$5.class
  2. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener$6.class
  3. BIN
      BankEconomyMod/bin/me/kaZep/Base/PlayerListener.class
  4. 2
      BankEconomyMod/plugin.yml
  5. 56
      BankEconomyMod/src/me/kaZep/Base/PlayerListener.java

@ -1,6 +1,6 @@
name: BankEconomy name: BankEconomy
main: me.kaZep.Base.Main main: me.kaZep.Base.Main
version: 256 version: 257
description: Bank plugin which stores money. description: Bank plugin which stores money.
commands: commands:
bankeconomy: bankeconomy:

@ -5534,10 +5534,18 @@ public ItemStack getGoodie() {
if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) { if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) {
for (int i=0;i<item.getItemMeta().getLore().size();i++) { for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) {
if (block_chance==0) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
block_chance+=block_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) {
if (speed_boost_chance==0) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
speed_boost_chance+=speed_boost_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)));
}
} }
} }
} }
@ -5589,10 +5597,18 @@ public ItemStack getGoodie() {
if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) { if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) {
for (int i=0;i<item.getItemMeta().getLore().size();i++) { for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) {
if (block_chance==0) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
block_chance+=block_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) {
if (speed_boost_chance==0) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
speed_boost_chance+=speed_boost_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)));
}
} }
} }
} }
@ -5635,10 +5651,18 @@ public ItemStack getGoodie() {
if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) { if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) {
for (int i=0;i<item.getItemMeta().getLore().size();i++) { for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) {
if (block_chance==0) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
block_chance+=block_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) {
if (speed_boost_chance==0) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
speed_boost_chance+=speed_boost_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)));
}
} }
} }
} }
@ -5681,10 +5705,18 @@ public ItemStack getGoodie() {
if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) { if (item.getItemMeta()!=null && item.getItemMeta().getLore()!=null && item.getItemMeta().getLore().size()!=0) {
for (int i=0;i<item.getItemMeta().getLore().size();i++) { for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Block Chance")) {
if (block_chance==0) {
block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); block_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
block_chance+=block_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Speed Boost Chance")) {
if (speed_boost_chance==0) {
speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); speed_boost_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
speed_boost_chance+=speed_boost_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)));
}
} }
} }
} }
@ -5958,16 +5990,28 @@ public ItemStack getGoodie() {
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. 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++) { for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Critical Chance")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Critical Chance")) {
if (critical_chance==0) {
critical_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); critical_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
critical_chance+=critical_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Armor Penetration")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Armor Penetration")) {
armor_pen+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); armor_pen+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Life Steal")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Life Steal")) {
if (life_steal==0) {
life_steal+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); life_steal+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
life_steal+=life_steal*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Attack Speed")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Attack Speed")) {
if (attack_speed==0) {
attack_speed+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); attack_speed+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
attack_speed+=attack_speed*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Damage")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Damage")) {
dmg+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); dmg+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
@ -6109,16 +6153,28 @@ public ItemStack getGoodie() {
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. 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++) { for (int i=0;i<item.getItemMeta().getLore().size();i++) {
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Critical Chance")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Critical Chance")) {
if (critical_chance==0) {
critical_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); critical_chance+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
critical_chance+=critical_chance*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Armor Penetration")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Armor Penetration")) {
armor_pen+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); armor_pen+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Life Steal")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Life Steal")) {
if (life_steal==0) {
life_steal+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); life_steal+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
life_steal+=life_steal*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Attack Speed")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Attack Speed")) {
if (attack_speed==0) {
attack_speed+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); attack_speed+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));
} else {
attack_speed+=attack_speed*(this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i))/100d);
}
} }
if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Damage")) { if (this.plugin.containsEnchantment(item.getItemMeta().getLore().get(i), "Damage")) {
dmg+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i)); dmg+=this.plugin.getEnchantmentNumb(item.getItemMeta().getLore().get(i));

Loading…
Cancel
Save