mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 20:49:05 +00:00
Made NPC dialog event cancellable
This commit is contained in:
1 parent
9c82e60a6e
commit
6782a5b9ba
3 files changed
+7
-7
No files matched your search
@@ -183,6 +183,9 @@ public class NoppesUtilServer {
|
||||
Dialog dialog = dia.copy(player);
|
||||
|
||||
if (!npc.isRemote()) {
|
||||
if (EventHooks.onNPCDialog(npc, player, dialog.id, optionId, dialog)) {
|
||||
return;
|
||||
}
|
||||
EventHooks.onDialogOpen(new DialogEvent.DialogOpen((IPlayer) NpcAPI.Instance().getIEntity(player), dialog));
|
||||
}
|
||||
|
||||
@@ -204,10 +207,6 @@ public class NoppesUtilServer {
|
||||
if(!data.dialogsRead.contains(dialog.id))
|
||||
data.dialogsRead.add(dialog.id);
|
||||
setEditingNpc(player, npc);
|
||||
|
||||
if (!npc.isRemote()) {
|
||||
EventHooks.onNPCDialog(npc, player, dialog.id, optionId, dialog);
|
||||
}
|
||||
}
|
||||
public static void runCommand(EntityPlayer player, String name, String command){
|
||||
runCommand(player, name, command, player);
|
||||
|
||||
Reference in new issue
Block a user