mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 00:39:40 +00:00
IActionListener W.I.P
This commit is contained in:
1 parent
91dc56bf87
commit
994cadfc3b
3 files changed
+143
-8
No files matched your search
@@ -2,6 +2,7 @@ package noppes.npcs.controllers.data.action;
|
||||
|
||||
import noppes.npcs.api.handler.IActionManager;
|
||||
import noppes.npcs.api.handler.data.IAction;
|
||||
import noppes.npcs.api.handler.data.IActionListener;
|
||||
import noppes.npcs.api.handler.data.IActionQueue;
|
||||
import noppes.npcs.api.handler.data.actions.IConditionalAction;
|
||||
import noppes.npcs.controllers.ScriptContainer;
|
||||
@@ -257,6 +258,23 @@ public class Action implements IAction {
|
||||
return done;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
// Listener
|
||||
|
||||
public IAction listenTo(String hook, Object object) {
|
||||
return listenTo(hook, manager.getOrCreateListener(object));
|
||||
}
|
||||
|
||||
public IAction listenTo(String hook, IActionListener listener) {
|
||||
return listenTo(listener.getOrCreateHook(hook));
|
||||
}
|
||||
|
||||
public IAction listenTo(ActionListener.Hook hook) {
|
||||
hook.schedule(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////
|
||||
// Handling
|
||||
|
||||
Reference in new issue
Block a user