mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-26 19:43:07 +00:00
BUNCH OF NEW PACKETS
This commit is contained in:
1 parent
f2c34699b1
commit
b22105341f
50 files changed
+620
-392
No files matched your search
@@ -1,5 +1,8 @@
|
||||
package noppes.npcs.client.gui.advanced;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.faction.FactionSetPacket;
|
||||
import kamkeel.npcs.network.packets.request.mainmenu.MainmenuAdvancedSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
@@ -15,7 +18,7 @@ public class GuiNPCFactionSetup extends GuiNPCInterface2 implements IScrollData,
|
||||
{
|
||||
private GuiCustomScroll scrollFactions;
|
||||
private HashMap<String,Integer> data = new HashMap<String,Integer>();
|
||||
|
||||
|
||||
public GuiNPCFactionSetup(EntityNPCInterface npc)
|
||||
{
|
||||
super(npc);
|
||||
@@ -34,7 +37,7 @@ public class GuiNPCFactionSetup extends GuiNPCInterface2 implements IScrollData,
|
||||
|
||||
this.addLabel(new GuiNpcLabel(12, "faction.ondeath", guiLeft + 4, guiTop + 69));
|
||||
addButton(new GuiNpcButton(12, guiLeft + 90, guiTop + 64, 80, 20, "faction.points"));
|
||||
|
||||
|
||||
if(scrollFactions == null){
|
||||
scrollFactions = new GuiCustomScroll(this,0,0);
|
||||
scrollFactions.setSize(180, 200);
|
||||
@@ -59,41 +62,41 @@ public class GuiNPCFactionSetup extends GuiNPCInterface2 implements IScrollData,
|
||||
if(button.id == 12)
|
||||
setSubGui(new SubGuiNpcFactionOptions(npc.advanced.factions));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setData(Vector<String> list, HashMap<String, Integer> data)
|
||||
public void setData(Vector<String> list, HashMap<String, Integer> data)
|
||||
{
|
||||
String name = npc.getFaction().name;
|
||||
this.data = data;
|
||||
scrollFactions.setList(list);
|
||||
|
||||
|
||||
if(name != null)
|
||||
setSelected(name);
|
||||
}
|
||||
|
||||
|
||||
public void mouseClicked(int i, int j, int k)
|
||||
{
|
||||
super.mouseClicked(i, j, k);
|
||||
if(k == 0 && scrollFactions != null)
|
||||
scrollFactions.mouseClicked(i, j, k);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setSelected(String selected) {
|
||||
scrollFactions.setSelected(selected);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void customScrollClicked(int i, int j, int k, GuiCustomScroll guiCustomScroll) {
|
||||
if(guiCustomScroll.id == 0)
|
||||
{
|
||||
Client.sendData(EnumPacketServer.FactionSet, data.get(scrollFactions.getSelected()));
|
||||
PacketClient.sendClient(new FactionSetPacket(data.get(scrollFactions.getSelected())));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void save() {
|
||||
Client.sendData(EnumPacketServer.MainmenuAdvancedSave, npc.advanced.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
PacketClient.sendClient(new MainmenuAdvancedSavePacket(npc.advanced.writeToNBT(new NBTTagCompound())));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user