mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 13:25:10 +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
@@ -1,9 +1,11 @@
|
||||
package noppes.npcs.scripted.event;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import noppes.npcs.api.event.IFactionEvent;
|
||||
import noppes.npcs.api.handler.data.IFaction;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
|
||||
public class FactionEvent extends CustomNPCsEvent {
|
||||
public class FactionEvent extends CustomNPCsEvent implements IFactionEvent {
|
||||
public final IFaction faction;
|
||||
public final IPlayer player;
|
||||
|
||||
@@ -12,7 +14,16 @@ public class FactionEvent extends CustomNPCsEvent {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public static class FactionPoints extends FactionEvent {
|
||||
public IPlayer getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public IFaction getFaction() {
|
||||
return faction;
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class FactionPoints extends FactionEvent implements IFactionEvent.FactionPoints {
|
||||
public boolean decrease;
|
||||
public int points;
|
||||
|
||||
@@ -21,5 +32,13 @@ public class FactionEvent extends CustomNPCsEvent {
|
||||
this.decrease = decrease;
|
||||
this.points = points;
|
||||
}
|
||||
|
||||
public boolean decreased() {
|
||||
return decrease;
|
||||
}
|
||||
|
||||
public int getPoints() {
|
||||
return points;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user