use of betterquesting.api.client.gui.controls.GuiButtonQuestInstance in project BetterQuesting by Funwayguy.
the class ToolboxToolComplete 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("state", true);
PacketSender.INSTANCE.sendToServer(new QuestingPacket(PacketTypeNative.QUEST_EDIT.GetLocation(), tags));
}
}
use of betterquesting.api.client.gui.controls.GuiButtonQuestInstance in project BetterQuesting by Funwayguy.
the class ToolboxToolDelete 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();
// Delete quest
tags.setInteger("action", EnumPacketAction.REMOVE.ordinal());
tags.setInteger("questID", QuestDatabase.INSTANCE.getKey(btn.getQuest()));
PacketSender.INSTANCE.sendToServer(new QuestingPacket(PacketTypeNative.QUEST_EDIT.GetLocation(), tags));
}
}
use of betterquesting.api.client.gui.controls.GuiButtonQuestInstance in project BetterQuesting by Funwayguy.
the class ToolboxToolIcon 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) {
Minecraft mc = Minecraft.getMinecraft();
btn.playPressSound(mc.getSoundHandler());
mc.displayGuiScreen(new GuiToolIconProxy(mc.currentScreen, btn.getQuest()));
}
}
use of betterquesting.api.client.gui.controls.GuiButtonQuestInstance in project BetterQuesting by Funwayguy.
the class ToolboxToolOpen 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) {
int qID = QuestDatabase.INSTANCE.getKey(btn.getQuest());
Minecraft mc = Minecraft.getMinecraft();
btn.playPressSound(mc.getSoundHandler());
mc.displayGuiScreen(new GuiQuest(mc.currentScreen, qID));
}
}
use of betterquesting.api.client.gui.controls.GuiButtonQuestInstance in project BetterQuesting by Funwayguy.
the class ToolboxToolRemove method onMouseClick.
@Override
public void onMouseClick(int mx, int my, int click) {
if (click != 0) {
return;
}
IQuestLine line = gui.getQuestLine().getQuestLine();
GuiButtonQuestInstance btn = gui.getQuestLine().getButtonAt(mx, my);
if (line != null && btn != null) {
int qID = QuestDatabase.INSTANCE.getKey(btn.getQuest());
line.removeKey(qID);
NBTTagCompound tags = new NBTTagCompound();
tags.setInteger("action", EnumPacketAction.EDIT.ordinal());
NBTTagCompound base = new NBTTagCompound();
base.setTag("line", line.writeToNBT(new NBTTagCompound(), EnumSaveType.CONFIG));
tags.setTag("data", base);
tags.setInteger("lineID", QuestLineDatabase.INSTANCE.getKey(line));
PacketSender.INSTANCE.sendToServer(new QuestingPacket(PacketTypeNative.LINE_EDIT.GetLocation(), tags));
}
}
Aggregations