Dialog and Quest Saving Bug

This commit is contained in:
Kam committed 2026-02-24 19:03:26 -05:00
1 parent b2f89035b9
commit 9eadeaa611
2 files changed
+17

No files matched your search

@@ -13,10 +13,13 @@ import kamkeel.npcs.util.ByteBufUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import kamkeel.npcs.network.packets.data.large.GuiDataPacket;
import noppes.npcs.CustomNpcsPermissions;
import noppes.npcs.NoppesUtilServer;
import noppes.npcs.controllers.DialogController;
import noppes.npcs.controllers.QuestController;
import noppes.npcs.controllers.data.Dialog;
import noppes.npcs.controllers.data.Quest;
import java.io.IOException;
@@ -80,6 +83,13 @@ public final class DialogSavePacket extends AbstractPacket {
} else {
NoppesUtilServer.sendDialogData((EntityPlayerMP) player, dialog.category);
}
// Send full dialog data back so the client doesn't need a second round-trip
NBTTagCompound dialogData = dialog.writeToNBT(new NBTTagCompound());
Quest quest = QuestController.Instance.quests.get(dialog.quest);
if (quest != null)
dialogData.setString("DialogQuestName", quest.title);
GuiDataPacket.sendGuiData((EntityPlayerMP) player, dialogData);
}
}
}
@@ -13,6 +13,7 @@ import kamkeel.npcs.util.ByteBufUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import kamkeel.npcs.network.packets.data.large.GuiDataPacket;
import noppes.npcs.CustomNpcsPermissions;
import noppes.npcs.NoppesUtilServer;
import noppes.npcs.controllers.QuestController;
@@ -79,6 +80,12 @@ public final class QuestSavePacket extends AbstractPacket {
} else {
NoppesUtilServer.sendQuestData((EntityPlayerMP) player, quest.category);
}
// Send full quest data back so the client doesn't need a second round-trip
NBTTagCompound questData = new NBTTagCompound();
if (quest.hasNewQuest())
questData.setString("NextQuestTitle", quest.getNextQuest().title);
GuiDataPacket.sendGuiData((EntityPlayerMP) player, quest.writeToNBT(questData));
}
}
}