mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 11:59:26 +00:00
Linked Packets
This commit is contained in:
1 parent
35da0f92f6
commit
b15d64bd09
9 files changed
+53
-51
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.linked.LinkedGetAllPacket;
|
||||
import kamkeel.npcs.network.packets.request.linked.LinkedSetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.client.Client;
|
||||
@@ -15,21 +18,21 @@ import java.util.Vector;
|
||||
public class GuiNPCAdvancedLinkedNpc extends GuiNPCInterface2 implements IScrollData, ICustomScrollListener{
|
||||
private GuiCustomScroll scroll;
|
||||
private List<String> data = new ArrayList<String>();
|
||||
|
||||
|
||||
public static GuiScreen Instance;
|
||||
|
||||
|
||||
public GuiNPCAdvancedLinkedNpc(EntityNPCInterface npc){
|
||||
super(npc);
|
||||
Instance = this;
|
||||
Client.sendData(EnumPacketServer.LinkedGetAll);
|
||||
PacketClient.sendClient(new LinkedGetAllPacket());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui(){
|
||||
super.initGui();
|
||||
|
||||
|
||||
this.addButton(new GuiNpcButton(1,guiLeft + 358, guiTop + 38, 58, 20, "gui.clear"));
|
||||
|
||||
|
||||
if(scroll == null){
|
||||
scroll = new GuiCustomScroll(this,0);
|
||||
scroll.setSize(143, 208);
|
||||
@@ -44,9 +47,9 @@ public class GuiNPCAdvancedLinkedNpc extends GuiNPCInterface2 implements IScroll
|
||||
@Override
|
||||
public void buttonEvent(GuiButton button){
|
||||
if(button.id == 1){
|
||||
Client.sendData(EnumPacketServer.LinkedSet, "");
|
||||
PacketClient.sendClient(new LinkedSetPacket(""));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -62,13 +65,13 @@ public class GuiNPCAdvancedLinkedNpc extends GuiNPCInterface2 implements IScroll
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void customScrollClicked(int i, int j, int k,
|
||||
GuiCustomScroll guiCustomScroll) {
|
||||
Client.sendData(EnumPacketServer.LinkedSet, guiCustomScroll.getSelected());
|
||||
PacketClient.sendClient(new LinkedSetPacket(guiCustomScroll.getSelected()));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user