use of betterquesting.api.network.QuestingPacket in project BetterQuesting by Funwayguy.
the class GuiPrerequisiteEditor method createQuest.
public void createQuest() {
NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("action", EnumPacketAction.ADD.ordinal());
PacketSender.INSTANCE.sendToServer(new QuestingPacket(PacketTypeNative.QUEST_EDIT.GetLocation(), tag));
}
use of betterquesting.api.network.QuestingPacket in project BetterQuesting by Funwayguy.
the class GuiQuestEditor method SendChanges.
// If the changes are approved by the server, it will be broadcast to all players including the editor
public void SendChanges() {
NBTTagCompound base = new NBTTagCompound();
base.setTag("config", quest.writeToNBT(new NBTTagCompound(), EnumSaveType.CONFIG));
base.setTag("progress", quest.writeToNBT(new NBTTagCompound(), EnumSaveType.PROGRESS));
NBTTagCompound tags = new NBTTagCompound();
// Action: Update data
tags.setInteger("action", EnumPacketAction.EDIT.ordinal());
tags.setInteger("questID", id);
tags.setTag("data", base);
PacketSender.INSTANCE.sendToServer(new QuestingPacket(PacketTypeNative.QUEST_EDIT.GetLocation(), tags));
}
use of betterquesting.api.network.QuestingPacket in project BetterQuesting by Funwayguy.
the class GuiQuestLineEditorA method DeleteQuest.
public void DeleteQuest(int id) {
NBTTagCompound tags = new NBTTagCompound();
tags.setInteger("action", 1);
tags.setInteger("questID", id);
PacketSender.INSTANCE.sendToServer(new QuestingPacket(PacketTypeNative.QUEST_EDIT.GetLocation(), tags));
}
use of betterquesting.api.network.QuestingPacket in project BetterQuesting by Funwayguy.
the class GuiQuestLineEditorA method SendChanges.
public void SendChanges(EnumPacketAction action, int lineID, int order) {
IQuestLine questLine = QuestLineDatabase.INSTANCE.getValue(lineID);
if (action == null) {
return;
}
NBTTagCompound tags = new NBTTagCompound();
if (action == EnumPacketAction.EDIT && questLine != null) {
NBTTagCompound base = new NBTTagCompound();
base.setTag("line", questLine.writeToNBT(new NBTTagCompound(), EnumSaveType.CONFIG));
tags.setTag("data", base);
}
tags.setInteger("lineID", questLine == null ? -1 : QuestLineDatabase.INSTANCE.getKey(questLine));
tags.setInteger("order", order);
tags.setInteger("action", action.ordinal());
PacketSender.INSTANCE.sendToServer(new QuestingPacket(PacketTypeNative.LINE_EDIT.GetLocation(), tags));
}
use of betterquesting.api.network.QuestingPacket in project BetterQuesting by Funwayguy.
the class GuiQuestLineEditorB method SendChanges.
public void SendChanges(EnumPacketAction action, int lineID) {
if (action == null) {
return;
}
NBTTagCompound tags = new NBTTagCompound();
if (action == EnumPacketAction.EDIT && line != null) {
NBTTagCompound base = new NBTTagCompound();
base.setTag("line", line.writeToNBT(new NBTTagCompound(), EnumSaveType.CONFIG));
tags.setTag("data", base);
}
tags.setInteger("action", action.ordinal());
tags.setInteger("lineID", QuestLineDatabase.INSTANCE.getKey(line));
PacketSender.INSTANCE.sendToServer(new QuestingPacket(PacketTypeNative.LINE_EDIT.GetLocation(), tags));
}
Aggregations