Added dialog events to scripted player events

This commit is contained in:
luisc committed 2022-01-12 22:59:03 -06:00
1 parent b024f800ae
commit 04def38b63
11 files changed
+102 -18

No files matched your search

@@ -72,6 +72,8 @@ import noppes.npcs.controllers.TransportLocation;
import noppes.npcs.entity.EntityDialogNpc;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.roles.RoleTransporter;
import noppes.npcs.scripted.entity.ScriptPlayer;
import noppes.npcs.scripted.event.DialogEvent;
import noppes.npcs.scripted.event.ScriptEventDialog;
public class NoppesUtilServer {
@@ -180,6 +182,9 @@ public class NoppesUtilServer {
public static void openDialog(EntityPlayer player, EntityNPCInterface npc, Dialog dia){
Dialog dialog = dia.copy(player);
EventHooks.onDialogOpen(new DialogEvent.DialogOpen(new ScriptPlayer((EntityPlayerMP) player), dialog));
if(npc instanceof EntityDialogNpc){
dialog.hideNPC = true;
Server.sendData((EntityPlayerMP)player, EnumPacketClient.DIALOG_DUMMY, npc.getCommandSenderName(), dialog.writeToNBT(new NBTTagCompound()));