From bdae7bd68f8e0b902e160fcabff84e991331dab5 Mon Sep 17 00:00:00 2001 From: Magnus Ulf Date: Wed, 15 Jan 2020 12:07:04 +0100 Subject: [PATCH] Don't do econ stuff when econ features are disabled --- src/com/massivecraft/factions/engine/EngineEcon.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/massivecraft/factions/engine/EngineEcon.java b/src/com/massivecraft/factions/engine/EngineEcon.java index bc47a42f..92ead137 100644 --- a/src/com/massivecraft/factions/engine/EngineEcon.java +++ b/src/com/massivecraft/factions/engine/EngineEcon.java @@ -50,6 +50,8 @@ public class EngineEcon extends Engine @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void takeOnLeave(EventFactionsMembershipChange event) { + if (!Econ.isEnabled()) return; + // If a player is leaving the faction ... if (event.getReason() != MembershipChangeReason.LEAVE) return; @@ -58,7 +60,7 @@ public class EngineEcon extends Engine Faction oldFaction = mplayer.getFaction(); if (oldFaction.getMPlayers().size() > 1) return; - // ... then transfer all money to the player. + // ... then transfer all money to the player. double money = Econ.getMoney(oldFaction); if (money == 0) return; Econ.transferMoney(mplayer, oldFaction, mplayer, money);