mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Always call back events
This commit is contained in:
parent
e796eae3c3
commit
3d242bbdb6
@ -237,7 +237,6 @@ public class Config extends AutoUpdateConfigLoader {
|
|||||||
public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); }
|
public boolean getStatsTrackingEnabled() { return config.getBoolean("General.Stats_Tracking", true); }
|
||||||
public boolean getUpdateCheckEnabled() { return config.getBoolean("General.Update_Check", true); }
|
public boolean getUpdateCheckEnabled() { return config.getBoolean("General.Update_Check", true); }
|
||||||
public boolean getPreferBeta() { return config.getBoolean("General.Prefer_Beta", false); }
|
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 getVerboseLoggingEnabled() { return config.getBoolean("General.Verbose_Logging", false); }
|
||||||
|
|
||||||
public String getPartyChatPrefix() { return config.getString("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); }
|
public String getPartyChatPrefix() { return config.getString("Commands.partychat.Chat_Prefix_Format", "[[GREEN]]([[WHITE]]{0}[[GREEN]])"); }
|
||||||
|
@ -613,9 +613,6 @@ public final class CombatUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static double callFakeDamageEvent(Entity attacker, Entity target, DamageCause cause, Map<DamageModifier, Double> modifiers) {
|
public static double callFakeDamageEvent(Entity attacker, Entity target, DamageCause cause, Map<DamageModifier, Double> modifiers) {
|
||||||
double finalDamage = 0;
|
|
||||||
|
|
||||||
if (Config.getInstance().getEventCallbackEnabled()) {
|
|
||||||
EntityDamageEvent damageEvent = attacker == null ? new FakeEntityDamageEvent(target, cause, modifiers) : new FakeEntityDamageByEntityEvent(attacker, target, cause, modifiers);
|
EntityDamageEvent damageEvent = attacker == null ? new FakeEntityDamageEvent(target, cause, modifiers) : new FakeEntityDamageByEntityEvent(attacker, target, cause, modifiers);
|
||||||
mcMMO.p.getServer().getPluginManager().callEvent(damageEvent);
|
mcMMO.p.getServer().getPluginManager().callEvent(damageEvent);
|
||||||
|
|
||||||
@ -623,10 +620,7 @@ public final class CombatUtils {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
finalDamage = damageEvent.getFinalDamage();
|
return damageEvent.getFinalDamage();
|
||||||
}
|
|
||||||
|
|
||||||
return finalDamage;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Map<DamageModifier, Double> getModifiers(EntityDamageEvent event) {
|
public static Map<DamageModifier, Double> getModifiers(EntityDamageEvent event) {
|
||||||
|
@ -17,8 +17,6 @@ General:
|
|||||||
# Allow mcMMO to check if a new version is available
|
# Allow mcMMO to check if a new version is available
|
||||||
Update_Check: true
|
Update_Check: true
|
||||||
Prefer_Beta: false
|
Prefer_Beta: false
|
||||||
# Allow mcMMO to inform other plugins of damage being dealt
|
|
||||||
Event_Callback: true
|
|
||||||
Power_Level_Cap: 0
|
Power_Level_Cap: 0
|
||||||
# Should mcMMO print out debug messages?
|
# Should mcMMO print out debug messages?
|
||||||
Verbose_Logging: false
|
Verbose_Logging: false
|
||||||
|
Loading…
Reference in New Issue
Block a user