Attempting to fix issues #272 , #266 , #261 , and #255 .

This commit is contained in:
U-YUE\Sean
2012-10-30 11:46:52 -07:00
parent 8dfa8c20f3
commit ab7a83b37e
18 changed files with 161 additions and 0 deletions

View File

@@ -30,6 +30,9 @@ public class Axes {
* @param event The event to modify
*/
public static void axesBonus(Player attacker, EntityDamageByEntityEvent event) {
if(attacker == null)
return;
final int MAX_BONUS = 4;
/* Add 1 DMG for every 50 skill levels */
@@ -49,6 +52,9 @@ public class Axes {
* @param event The event to modify
*/
public static void axeCriticalCheck(Player attacker, EntityDamageByEntityEvent event) {
if(attacker == null)
return;
Entity entity = event.getEntity();
if (entity instanceof Tameable) {
@@ -104,6 +110,8 @@ public class Axes {
*/
@SuppressWarnings("deprecation")
public static void impact(Player attacker, LivingEntity target, EntityDamageByEntityEvent event) {
if(attacker == null)
return;
/*
* TODO: Finish this skill. The idea is you will greatly damage an opponents armor.
@@ -140,6 +148,9 @@ public class Axes {
* @param event The event to modify
*/
private static void applyGreaterImpact(Player attacker, LivingEntity target, EntityDamageByEntityEvent event) {
if(attacker == null)
return;
final int GREATER_IMPACT_CHANCE = 25;
final double GREATER_IMPACT_MULTIPLIER = 1.5;
@@ -167,6 +178,9 @@ public class Axes {
* @return true if the player has armor, false otherwise
*/
private static boolean hasArmor(Player player) {
if(player == null)
return false;
PlayerInventory inventory = player.getInventory();
if (inventory.getBoots() != null || inventory.getChestplate() != null || inventory.getHelmet() != null || inventory.getLeggings() != null) {