mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-21 02:12:19 +00:00
Changed Player Dialog Events to work like NPC Dialog Events
This commit is contained in:
1 parent
9ebaf780e1
commit
92e69bb270
3 files changed
+23
-12
No files matched your search
@@ -306,18 +306,18 @@ public class NoppesUtilPlayer {
|
||||
if (dialog == null)
|
||||
return;
|
||||
DialogOption option = dialog.options.get(optionId);
|
||||
if (EventHooks.onDialogOption(player, new DialogEvent.DialogOption((IPlayer) NpcAPI.Instance().getIEntity(player), dialog)))
|
||||
if (EventHooks.onDialogOption(player, new DialogEvent.DialogOption((IPlayer) NpcAPI.Instance().getIEntity(player), dialogId, optionId, dialog)))
|
||||
return;
|
||||
|
||||
if (!npc.isRemote()) {
|
||||
EventHooks.onNPCDialogClosed(npc, player, dialogId, optionId + 1, dialog);
|
||||
|
||||
if (!dialog.hasDialogs(player) && !dialog.hasOtherOptions()) {
|
||||
EventHooks.onDialogClosed(player, new DialogEvent.DialogClosed((IPlayer) NpcAPI.Instance().getIEntity(player), dialog));
|
||||
EventHooks.onDialogClosed(player, new DialogEvent.DialogClosed((IPlayer) NpcAPI.Instance().getIEntity(player), dialogId, optionId, dialog));
|
||||
return;
|
||||
}
|
||||
if (option == null || option.optionType == EnumOptionType.DialogOption && (!option.isAvailable(player) || !option.hasDialog()) || option.optionType == EnumOptionType.Disabled || option.optionType == EnumOptionType.QuitOption) {
|
||||
EventHooks.onDialogClosed(player, new DialogEvent.DialogClosed((IPlayer) NpcAPI.Instance().getIEntity(player), dialog));
|
||||
EventHooks.onDialogClosed(player, new DialogEvent.DialogClosed((IPlayer) NpcAPI.Instance().getIEntity(player), dialogId, optionId, dialog));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user