mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 20:25:13 +00:00
Added getHookName() function
This commit is contained in:
1 parent
8ea98cba9b
commit
681f62eeb6
12 files changed
+383
-3
No files matched your search
@@ -20,6 +20,7 @@ import noppes.npcs.api.entity.IEntityLivingBase;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.event.IPlayerEvent;
|
||||
import noppes.npcs.api.item.IItemStack;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
|
||||
public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
@@ -42,6 +43,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.CHAT.function;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
@@ -71,6 +76,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.keysDown = heldKeys;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.KEY_PRESSED.function;
|
||||
}
|
||||
|
||||
public int getKey() {
|
||||
return key;
|
||||
}
|
||||
@@ -123,6 +132,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.keysDown = heldKeys;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.MOUSE_CLICKED.function;
|
||||
}
|
||||
|
||||
public int getButton() {
|
||||
return button;
|
||||
}
|
||||
@@ -164,6 +177,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.amount = orb.xpValue;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.PICKUP_XP.function;
|
||||
}
|
||||
|
||||
public int getAmount() {
|
||||
return amount;
|
||||
}
|
||||
@@ -177,6 +194,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.change = change;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.LEVEL_UP.function;
|
||||
}
|
||||
|
||||
public int getChange() {
|
||||
return change;
|
||||
}
|
||||
@@ -186,18 +207,30 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
public LogoutEvent(IPlayer player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.LOGOUT.function;
|
||||
}
|
||||
}
|
||||
|
||||
public static class LoginEvent extends PlayerEvent implements IPlayerEvent.LoginEvent {
|
||||
public LoginEvent(IPlayer player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.LOGIN.function;
|
||||
}
|
||||
}
|
||||
|
||||
public static class RespawnEvent extends PlayerEvent implements IPlayerEvent.RespawnEvent {
|
||||
public RespawnEvent(IPlayer player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.RESPAWN.function;
|
||||
}
|
||||
}
|
||||
|
||||
public static class ChangedDimension extends PlayerEvent implements IPlayerEvent.ChangedDimension {
|
||||
@@ -210,6 +243,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.toDim = toDim;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.CHANGED_DIM.function;
|
||||
}
|
||||
|
||||
public int getFromDim() {
|
||||
return fromDim;
|
||||
}
|
||||
@@ -227,6 +264,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.TIMER.function;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
@@ -245,6 +286,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.damageSource = NpcAPI.Instance().getIDamageSource(damagesource);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.ATTACKED.function;
|
||||
}
|
||||
|
||||
public IDamageSource getDamageSource() {
|
||||
return damageSource;
|
||||
}
|
||||
@@ -272,6 +317,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.damageSource = NpcAPI.Instance().getIDamageSource(damagesource);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.DAMAGED.function;
|
||||
}
|
||||
|
||||
public IDamageSource getDamageSource() {
|
||||
return damageSource;
|
||||
}
|
||||
@@ -290,6 +339,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
public LightningEvent(IPlayer player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.LIGHTNING.function;
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
@@ -305,6 +358,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.volume = volume;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.PLAYSOUND.function;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
@@ -327,6 +384,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.distance = distance;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.FALL.function;
|
||||
}
|
||||
|
||||
public float getDistance() {
|
||||
return distance;
|
||||
}
|
||||
@@ -336,6 +397,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
public JumpEvent(IPlayer player){
|
||||
super(player);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.JUMP.function;
|
||||
}
|
||||
}
|
||||
|
||||
public static class KilledEntityEvent extends PlayerEvent implements IPlayerEvent.KilledEntityEvent {
|
||||
@@ -346,6 +411,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.entity = (IEntityLivingBase) NpcAPI.Instance().getIEntity(entity);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.KILLS.function;
|
||||
}
|
||||
|
||||
public IEntityLivingBase getEntity() {
|
||||
return entity;
|
||||
}
|
||||
@@ -363,6 +432,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.source = NpcAPI.Instance().getIEntity(entity);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.KILLED.function;
|
||||
}
|
||||
|
||||
public IDamageSource getDamageSource() {
|
||||
return damageSource;
|
||||
}
|
||||
@@ -387,6 +460,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.charge = charge;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.RANGED_LAUNCHED.function;
|
||||
}
|
||||
|
||||
public IItemStack getBow() {
|
||||
return bow;
|
||||
}
|
||||
@@ -409,6 +486,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.damageSource = NpcAPI.Instance().getIDamageSource(damagesource);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.ATTACK.function;
|
||||
}
|
||||
|
||||
public IDamageSource getDamageSource() {
|
||||
return damageSource;
|
||||
}
|
||||
@@ -435,6 +516,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.damageSource = NpcAPI.Instance().getIDamageSource(damagesource);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.DAMAGED_ENTITY.function;
|
||||
}
|
||||
|
||||
public IDamageSource getDamageSource() {
|
||||
return damageSource;
|
||||
}
|
||||
@@ -456,6 +541,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.CONTAINER_CLOSED.function;
|
||||
}
|
||||
|
||||
public IContainer getContainer() {
|
||||
return container;
|
||||
}
|
||||
@@ -469,6 +558,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.CONTAINER_OPEN.function;
|
||||
}
|
||||
|
||||
public IContainer getContainer() {
|
||||
return container;
|
||||
}
|
||||
@@ -483,6 +576,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.PICKUP.function;
|
||||
}
|
||||
|
||||
public IItemStack getItem() {
|
||||
return item;
|
||||
}
|
||||
@@ -497,6 +594,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.items = items;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.DROP.function;
|
||||
}
|
||||
|
||||
public IItemStack[] getItems() {
|
||||
return items;
|
||||
}
|
||||
@@ -511,6 +612,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.TOSS.function;
|
||||
}
|
||||
|
||||
public IItemStack getItem() {
|
||||
return item;
|
||||
}
|
||||
@@ -527,6 +632,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.INTERACT.function;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
@@ -540,12 +649,20 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
public UpdateEvent(IPlayer player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.TICK.function;
|
||||
}
|
||||
}
|
||||
|
||||
public static class InitEvent extends PlayerEvent implements IPlayerEvent.InitEvent {
|
||||
public InitEvent(IPlayer player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.INIT.function;
|
||||
}
|
||||
}
|
||||
|
||||
public static class StartUsingItem extends PlayerEvent implements IPlayerEvent.StartUsingItem {
|
||||
@@ -559,6 +676,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.START_USING_ITEM.function;
|
||||
}
|
||||
|
||||
public IItemStack getItem() {
|
||||
return item;
|
||||
}
|
||||
@@ -578,6 +699,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.USING_ITEM.function;
|
||||
}
|
||||
|
||||
public IItemStack getItem() {
|
||||
return item;
|
||||
}
|
||||
@@ -597,6 +722,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.STOP_USING_ITEM.function;
|
||||
}
|
||||
|
||||
public IItemStack getItem() {
|
||||
return item;
|
||||
}
|
||||
@@ -616,6 +745,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.FINISH_USING_ITEM.function;
|
||||
}
|
||||
|
||||
public IItemStack getItem() {
|
||||
return item;
|
||||
}
|
||||
@@ -636,6 +769,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.exp = exp;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.BREAK_BLOCK.function;
|
||||
}
|
||||
|
||||
public IBlock getBlock() {
|
||||
return block;
|
||||
}
|
||||
@@ -659,6 +796,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.USE_HOE.function;
|
||||
}
|
||||
|
||||
public IItemStack getHoe() {
|
||||
return hoe;
|
||||
}
|
||||
@@ -684,6 +825,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.setSpawn = setSpawn;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.WAKE_UP.function;
|
||||
}
|
||||
|
||||
public boolean setSpawn() {
|
||||
return setSpawn;
|
||||
}
|
||||
@@ -701,6 +846,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.SLEEP.function;
|
||||
}
|
||||
|
||||
public int getX() {
|
||||
return x;
|
||||
}
|
||||
@@ -722,6 +871,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.ACHIEVEMENT.function;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
@@ -737,6 +890,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.result = NpcAPI.Instance().getIItemStack(result);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.FILL_BUCKET.function;
|
||||
}
|
||||
|
||||
public IItemStack getCurrent() {
|
||||
return current;
|
||||
}
|
||||
@@ -760,6 +917,10 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.BONEMEAL.function;
|
||||
}
|
||||
|
||||
public IBlock getBlock() {
|
||||
return block;
|
||||
}
|
||||
@@ -781,5 +942,9 @@ public class PlayerEvent extends CustomNPCsEvent implements IPlayerEvent {
|
||||
public RangedChargeEvent(IPlayer player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.RANGED_LAUNCHED.function;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user