Implemented event interfaces, made more events cancellable.

This commit is contained in:
Luis C.M committed 2022-11-24 14:36:09 -06:00
1 parent aa02e5dcc3
commit 0414817673
32 files changed
+1298 -175

No files matched your search

@@ -63,7 +63,9 @@ public class PlayerFactionData implements IPlayerFactionData {
}
public void increasePoints(int factionId, int points, EntityPlayer player) {
EventHooks.onFactionPoints(new FactionEvent.FactionPoints((IPlayer) NpcAPI.Instance().getIEntity((EntityPlayerMP) player), FactionController.getInstance().get(factionId), points < 0, points));
if (EventHooks.onFactionPoints(new FactionEvent.FactionPoints((IPlayer) NpcAPI.Instance().getIEntity((EntityPlayerMP) player), FactionController.getInstance().get(factionId), points < 0, points)))
return;
if(!factionData.containsKey(factionId)){
Faction faction = FactionController.getInstance().get(factionId);
factionData.put(factionId, faction == null? -1 : faction.defaultPoints);