use of betterquesting.api.network.QuestingPacket in project BetterQuesting by Funwayguy.
the class ToolboxToolReset method onMouseClick.
@Override
public void onMouseClick(int mx, int my, int click) {
if (click != 0) {
return;
}
GuiButtonQuestInstance btn = gui.getQuestLine().getButtonAt(mx, my);
if (btn != null) {
NBTTagCompound tags = new NBTTagCompound();
// Complete quest
tags.setInteger("action", EnumPacketAction.SET.ordinal());
tags.setInteger("questID", QuestDatabase.INSTANCE.getKey(btn.getQuest()));
tags.setBoolean("status", false);
PacketSender.INSTANCE.sendToServer(new QuestingPacket(PacketTypeNative.QUEST_EDIT.GetLocation(), tags));
}
}
use of betterquesting.api.network.QuestingPacket in project BetterQuesting by Funwayguy.
the class QuestDatabase method getSyncPacket.
@Override
public QuestingPacket getSyncPacket() {
NBTTagCompound tags = new NBTTagCompound();
NBTTagCompound base = new NBTTagCompound();
base.setTag("config", writeToNBT(new NBTTagList(), EnumSaveType.CONFIG));
base.setTag("progress", writeToNBT(new NBTTagList(), EnumSaveType.PROGRESS));
tags.setTag("data", base);
return new QuestingPacket(PacketTypeNative.QUEST_DATABASE.GetLocation(), tags);
}
use of betterquesting.api.network.QuestingPacket in project BetterQuesting by Funwayguy.
the class QuestInstance method postNotice.
public void postNotice(EntityPlayer player, String mainTxt, String subTxt, String sound, BigItemStack icon) {
NBTTagCompound tags = new NBTTagCompound();
tags.setString("Main", mainTxt);
tags.setString("Sub", subTxt);
tags.setString("Sound", sound);
tags.setTag("Icon", icon.writeToNBT(new NBTTagCompound()));
QuestingPacket payload = new QuestingPacket(PacketTypeNative.NOTIFICATION.GetLocation(), tags);
if (qInfo.getProperty(NativeProps.GLOBAL)) {
PacketSender.INSTANCE.sendToAll(payload);
} else if (player instanceof EntityPlayerMP) {
List<EntityPlayerMP> tarList = getPartyPlayers((EntityPlayerMP) player);
for (EntityPlayerMP p : tarList) {
PacketSender.INSTANCE.sendToPlayer(payload, p);
}
}
}
use of betterquesting.api.network.QuestingPacket in project BetterQuesting by Funwayguy.
the class QuestLine method getSyncPacket.
@Override
public QuestingPacket getSyncPacket() {
NBTTagCompound tags = new NBTTagCompound();
NBTTagCompound base = new NBTTagCompound();
base.setTag("line", writeToNBT(new NBTTagCompound(), EnumSaveType.CONFIG));
tags.setTag("data", base);
tags.setInteger("lineID", parentDB.getKey(this));
return new QuestingPacket(PacketTypeNative.LINE_SYNC.GetLocation(), tags);
}
use of betterquesting.api.network.QuestingPacket in project BetterQuesting by Funwayguy.
the class QuestLineDatabase method getSyncPacket.
@Override
public QuestingPacket getSyncPacket() {
NBTTagCompound tags = new NBTTagCompound();
tags.setTag("data", writeToNBT(new NBTTagList(), EnumSaveType.CONFIG));
return new QuestingPacket(PacketTypeNative.LINE_DATABASE.GetLocation(), tags);
}
Aggregations