Lots more packet schtuff

This commit is contained in:
Kam committed 2025-02-02 17:00:32 -05:00
1 parent 601123811a
commit 55d271abad
27 files changed
+276 -190

No files matched your search

@@ -1,5 +1,7 @@
package noppes.npcs.client.gui;
import kamkeel.npcs.network.PacketClient;
import kamkeel.npcs.network.packets.request.TileEntityGetPacket;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.blocks.tiles.TileBorder;
@@ -10,27 +12,27 @@ import noppes.npcs.constants.EnumPacketServer;
public class GuiBorderBlock extends GuiNPCInterface implements IGuiData{
private TileBorder tile;
public GuiBorderBlock(int x, int y, int z) {
super();
tile = (TileBorder) player.worldObj.getTileEntity(x, y, z);
Client.sendData(EnumPacketServer.GetTileEntity, x, y, z);
PacketClient.sendClient(new TileEntityGetPacket(x, y, z));
}
public void initGui()
{
super.initGui();
this.addButton(new GuiNpcButton(4, guiLeft + 40, guiTop + 40, 120, 20, "Availability Options"));
addLabel(new GuiNpcLabel(0,"Height", guiLeft+ 1, guiTop + 76, 0xffffff));
addLabel(new GuiNpcLabel(0,"Height", guiLeft+ 1, guiTop + 76, 0xffffff));
addTextField(new GuiNpcTextField(0, this, fontRendererObj, guiLeft+ 60, guiTop + 71,40,20, tile.height + ""));
getTextField(0).integersOnly = true;
getTextField(0).setMinMaxDefault(0, 500, 6);
getTextField(0).setMinMaxDefault(0, 500, 6);
addLabel(new GuiNpcLabel(1,"Message", guiLeft+ 1, guiTop + 100, 0xffffff));
addLabel(new GuiNpcLabel(1,"Message", guiLeft+ 1, guiTop + 100, 0xffffff));
addTextField(new GuiNpcTextField(1, this, fontRendererObj, guiLeft+ 60, guiTop + 95,200,20, tile.message));
addButton(new GuiNpcButton(0, guiLeft + 40, guiTop + 190,120,20, "Done"));
}
protected void actionPerformed(GuiButton guibutton) {
@@ -48,7 +50,7 @@ public class GuiBorderBlock extends GuiNPCInterface implements IGuiData{
return;
tile.height = getTextField(0).getInteger();
tile.message = getTextField(1).getText();
NBTTagCompound compound = new NBTTagCompound();
tile.writeToNBT(compound);
Client.sendData(EnumPacketServer.SaveTileEntity, compound);