mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 04:05:12 +00:00
Implemented event interfaces, made more events cancellable.
This commit is contained in:
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);
|
||||
|
||||
Reference in new issue
Block a user