mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 21:59:05 +00:00
Fixed API interface errors, added casts for custom item script handlers in EventHooks, and added some event interfaces.
This commit is contained in:
1 parent
be9ae94163
commit
aa02e5dcc3
41 files changed
+181
-66
No files matched your search
@@ -15,6 +15,14 @@ public class CustomGuiEvent extends Event {
|
||||
this.gui = gui;
|
||||
}
|
||||
|
||||
public IPlayer getPlayer() {
|
||||
return this.player;
|
||||
}
|
||||
|
||||
public ICustomGui getGui() {
|
||||
return gui;
|
||||
}
|
||||
|
||||
public static class ButtonEvent extends CustomGuiEvent {
|
||||
public final int buttonId;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import noppes.npcs.api.AbstractNpcAPI;
|
||||
import noppes.npcs.api.IPos;
|
||||
import noppes.npcs.api.handler.data.INaturalSpawn;
|
||||
|
||||
public class CustomNPCsEvent extends Event{
|
||||
public class CustomNPCsEvent extends Event implements noppes.npcs.api.event.CustomNPCsEvent {
|
||||
public final AbstractNpcAPI API = AbstractNpcAPI.Instance();
|
||||
|
||||
public CustomNPCsEvent() {
|
||||
@@ -24,7 +24,7 @@ public class CustomNPCsEvent extends Event{
|
||||
public boolean isCancelled(){return this.isCanceled();}
|
||||
|
||||
@Cancelable
|
||||
public static class CNPCNaturalSpawnEvent extends CustomNPCsEvent {
|
||||
public static class CNPCNaturalSpawnEvent extends CustomNPCsEvent implements noppes.npcs.api.event.CustomNPCsEvent.CNPCNaturalSpawnEvent {
|
||||
public final INaturalSpawn naturalSpawn;
|
||||
public final IPos attemptPosition;
|
||||
public final boolean animalSpawnPassed;
|
||||
@@ -41,5 +41,29 @@ public class CustomNPCsEvent extends Event{
|
||||
this.liquidSpawnPassed = liquidSpawnPassed;
|
||||
this.airSpawnPassed = airSpawnPassed;
|
||||
}
|
||||
|
||||
public INaturalSpawn getNaturalSpawn() {
|
||||
return this.naturalSpawn;
|
||||
}
|
||||
|
||||
public IPos getAttemptPosition() {
|
||||
return this.attemptPosition;
|
||||
}
|
||||
|
||||
public boolean animalSpawnPassed() {
|
||||
return this.animalSpawnPassed;
|
||||
}
|
||||
|
||||
public boolean monsterSpawnPassed() {
|
||||
return this.monsterSpawnPassed;
|
||||
}
|
||||
|
||||
public boolean liquidSpawnPassed() {
|
||||
return this.liquidSpawnPassed;
|
||||
}
|
||||
|
||||
public boolean airSpawnPassed() {
|
||||
return this.airSpawnPassed;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user