mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 06:09:05 +00:00
Implemented event interfaces, made more events cancellable.
This commit is contained in:
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();
|
||||
|
||||
Reference in new issue
Block a user