mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 03:49: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
@@ -9,9 +9,10 @@ import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import noppes.npcs.api.AbstractNpcAPI;
|
||||
import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.event.ICustomNPCsEvent;
|
||||
import noppes.npcs.api.handler.data.INaturalSpawn;
|
||||
|
||||
public class CustomNPCsEvent extends Event implements noppes.npcs.api.event.CustomNPCsEvent {
|
||||
public class CustomNPCsEvent extends Event implements ICustomNPCsEvent {
|
||||
public final AbstractNpcAPI API = AbstractNpcAPI.Instance();
|
||||
|
||||
public CustomNPCsEvent() {
|
||||
@@ -24,9 +25,9 @@ public class CustomNPCsEvent extends Event implements noppes.npcs.api.event.Cust
|
||||
public boolean isCancelled(){return this.isCanceled();}
|
||||
|
||||
@Cancelable
|
||||
public static class CNPCNaturalSpawnEvent extends CustomNPCsEvent implements noppes.npcs.api.event.CustomNPCsEvent.CNPCNaturalSpawnEvent {
|
||||
public static class CNPCNaturalSpawnEvent extends CustomNPCsEvent implements ICustomNPCsEvent.CNPCNaturalSpawnEvent {
|
||||
public final INaturalSpawn naturalSpawn;
|
||||
public final IPos attemptPosition;
|
||||
public IPos attemptPosition;
|
||||
public final boolean animalSpawnPassed;
|
||||
public final boolean monsterSpawnPassed;
|
||||
public final boolean liquidSpawnPassed;
|
||||
@@ -46,6 +47,10 @@ public class CustomNPCsEvent extends Event implements noppes.npcs.api.event.Cust
|
||||
return this.naturalSpawn;
|
||||
}
|
||||
|
||||
public void setAttemptPosition(IPos attemptPosition) {
|
||||
this.attemptPosition = attemptPosition;
|
||||
}
|
||||
|
||||
public IPos getAttemptPosition() {
|
||||
return this.attemptPosition;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user