From a99293aa4865d4c5be001dbca2a4cc18cc482340 Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 23 Oct 2013 10:19:22 -0400 Subject: [PATCH] We should ALWAYS inform other plugins of what we're doing. --- src/main/java/com/gmail/nossr50/config/Config.java | 1 - .../com/gmail/nossr50/util/skills/CombatUtils.java | 14 +++++--------- src/main/resources/config.yml | 4 +--- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index ab56295d4..2ec75a8c3 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -205,7 +205,6 @@ public class Config extends AutoUpdateConfigLoader { public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); } public boolean getUpdateCheckEnabled() { return config.getBoolean("General.Update_Check", true); } public boolean getPreferBeta() { return config.getBoolean("General.Prefer_Beta", false); } - public boolean getEventCallbackEnabled() { return config.getBoolean("General.Event_Callback", true); } public boolean getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); } public boolean getConfigOverwriteEnabled() { return config.getBoolean("General.Config_Update_Overwrite", true); } diff --git a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java index 45ed3c2f9..36b6ae0cc 100644 --- a/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java +++ b/src/main/java/com/gmail/nossr50/util/skills/CombatUtils.java @@ -564,17 +564,13 @@ public final class CombatUtils { } public static double callFakeDamageEvent(Entity attacker, Entity target, DamageCause cause, double damage) { - if (Config.getInstance().getEventCallbackEnabled()) { - EntityDamageEvent damageEvent = attacker == null ? new FakeEntityDamageEvent(target, cause, damage) : new FakeEntityDamageByEntityEvent(attacker, target, cause, damage); - mcMMO.p.getServer().getPluginManager().callEvent(damageEvent); + EntityDamageEvent damageEvent = attacker == null ? new FakeEntityDamageEvent(target, cause, damage) : new FakeEntityDamageByEntityEvent(attacker, target, cause, damage); + mcMMO.p.getServer().getPluginManager().callEvent(damageEvent); - if (damageEvent.isCancelled()) { - return 0; - } - - damage = damageEvent.getDamage(); + if (damageEvent.isCancelled()) { + return 0; } - return damage; + return damageEvent.getDamage(); } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index f574af429..fde78753c 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -17,8 +17,6 @@ General: # Allow mcMMO to check if a new version is available Update_Check: true Prefer_Beta: false - # Allow mcMMO to inform other plugins of damage being dealt - Event_Callback: true Power_Level_Cap: 0 # Should mcMMO print out debug messages? Verbose_Logging: false @@ -402,4 +400,4 @@ Particles: # These settings determine if fireworks should get launched when a player levels-up, # this will happen by default for every 100 levels. LevelUp_Enabled: true - LevelUp_Tier: 100 \ No newline at end of file + LevelUp_Tier: 100