Added getHookName() function

This commit is contained in:
Luis C.M committed 2022-11-24 16:46:20 -06:00
1 parent 8ea98cba9b
commit 681f62eeb6
12 files changed
+383 -3

No files matched your search

@@ -5,6 +5,7 @@ import noppes.npcs.api.event.IItemEvent;
import noppes.npcs.api.item.IItemCustom;
import noppes.npcs.api.entity.IEntity;
import noppes.npcs.api.entity.IPlayer;
import noppes.npcs.constants.EnumScriptType;
public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
public final IItemCustom item;
@@ -17,10 +18,18 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
return item;
}
public String getHookName() {
return EnumScriptType.CUSTOM_ITEM_EVENT.function;
}
public static class InitEvent extends ItemEvent implements IItemEvent.InitEvent {
public InitEvent(IItemCustom item) {
super(item);
}
public String getHookName() {
return EnumScriptType.INIT.function;
}
}
public static class UpdateEvent extends ItemEvent implements IItemEvent.UpdateEvent {
@@ -31,6 +40,10 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
this.entity = entity;
}
public String getHookName() {
return EnumScriptType.TICK.function;
}
public IEntity getEntity() {
return entity;
}
@@ -47,6 +60,10 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
this.player = player;
}
public String getHookName() {
return EnumScriptType.TOSSED.function;
}
public IEntity getEntity() {
return entity;
}
@@ -64,6 +81,10 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
this.player = player;
}
public String getHookName() {
return EnumScriptType.PICKEDUP.function;
}
public IPlayer getPlayer() {
return player;
}
@@ -78,6 +99,10 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
this.entity = entity;
}
public String getHookName() {
return EnumScriptType.SPAWN.function;
}
public IEntity getEntity() {
return entity;
}
@@ -96,6 +121,10 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
this.player = player;
}
public String getHookName() {
return EnumScriptType.INTERACT.function;
}
public int getType() {
return type;
}
@@ -122,6 +151,10 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
this.swingingEntity = swingingEntity;
}
public String getHookName() {
return EnumScriptType.ATTACK.function;
}
public int getType() {
return type;
}
@@ -145,6 +178,10 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
this.duration = duration;
}
public String getHookName() {
return EnumScriptType.START_USING_ITEM.function;
}
public IPlayer getPlayer() {
return player;
}
@@ -163,6 +200,10 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
this.duration = duration;
}
public String getHookName() {
return EnumScriptType.USING_ITEM.function;
}
public IPlayer getPlayer() {
return player;
}
@@ -181,6 +222,10 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
this.duration = duration;
}
public String getHookName() {
return EnumScriptType.STOP_USING_ITEM.function;
}
public IPlayer getPlayer() {
return player;
}
@@ -199,6 +244,10 @@ public class ItemEvent extends CustomNPCsEvent implements IItemEvent {
this.duration = duration;
}
public String getHookName() {
return EnumScriptType.FINISH_USING_ITEM.function;
}
public IPlayer getPlayer() {
return player;
}