Implemented event interfaces, made more events cancellable.

This commit is contained in:
Luis C.M committed 2022-11-24 14:36:09 -06:00
1 parent aa02e5dcc3
commit 0414817673
32 files changed
+1298 -175

No files matched your search

@@ -273,8 +273,10 @@ public class NoppesUtilPlayer {
if(dialog == null)
return;
DialogOption option = dialog.options.get(optionId);
if (EventHooks.onDialogOption(new DialogEvent.DialogOption((IPlayer) NpcAPI.Instance().getIEntity(player), dialog)))
return;
if (!npc.isRemote()) {
EventHooks.onDialogOption(new DialogEvent.DialogOption((IPlayer) NpcAPI.Instance().getIEntity(player), dialog));
EventHooks.onNPCDialogClosed(npc, player, dialogId, optionId + 1, dialog);
if (!dialog.hasDialogs(player) && !dialog.hasOtherOptions()) {
@@ -343,6 +345,8 @@ public class NoppesUtilPlayer {
return;
QuestEvent.QuestTurnedInEvent event = new QuestEvent.QuestTurnedInEvent((IPlayer) NpcAPI.Instance().getIEntity(player), data.quest);
if (event.isCancelled())
return;
event.expReward = data.quest.rewardExp;
List<IItemStack> list = new ArrayList();