mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 17:39:39 +00:00
Organize Player Events
This commit is contained in:
1 parent
04bfbef219
commit
94d9d93360
16 files changed
+51
-68
No files matched your search
@@ -0,0 +1,58 @@
|
||||
package noppes.npcs.scripted.event.player;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.Cancelable;
|
||||
import noppes.npcs.api.entity.IPlayer;
|
||||
import noppes.npcs.api.event.IDialogEvent;
|
||||
import noppes.npcs.api.handler.data.IDialog;
|
||||
import noppes.npcs.constants.EnumScriptType;
|
||||
|
||||
public class DialogEvent extends PlayerEvent implements IDialogEvent {
|
||||
public final IDialog dialog;
|
||||
|
||||
public DialogEvent(IPlayer player, IDialog dialog) {
|
||||
super(player);
|
||||
this.dialog = dialog;
|
||||
}
|
||||
|
||||
public IDialog getDialog() {
|
||||
return dialog;
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.DIALOG_EVENT.function;
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class DialogOpen extends DialogEvent implements IDialogEvent.DialogOpen {
|
||||
public DialogOpen(IPlayer player, IDialog dialog) {
|
||||
super(player, dialog);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.DIALOG_OPEN.function;
|
||||
}
|
||||
}
|
||||
|
||||
@Cancelable
|
||||
public static class DialogOption extends DialogEvent implements IDialogEvent.DialogOption {
|
||||
public DialogOption(IPlayer player, IDialog dialog) {
|
||||
super(player, dialog);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.DIALOG_OPTION.function;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class DialogClosed extends DialogEvent implements IDialogEvent.DialogClosed {
|
||||
public DialogClosed(IPlayer player, IDialog dialog) {
|
||||
super(player, dialog);
|
||||
}
|
||||
|
||||
public String getHookName() {
|
||||
return EnumScriptType.DIALOG_CLOSE.function;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user