mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 21:32:19 +00:00
Dimension Get Packet
This commit is contained in:
1 parent
364bf2414f
commit
bd783a2e98
5 files changed
+14
-13
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.DimensionsGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
@@ -14,14 +16,14 @@ public class SubGuiNpcDimensions extends SubGuiInterface implements IScrollData
|
||||
private GuiCustomScroll allDimensions;
|
||||
private HashMap<String, Integer> dimensionMap = new HashMap<>();
|
||||
private GuiCustomScroll dataDimensions;
|
||||
|
||||
|
||||
public SubGuiNpcDimensions(SpawnData data){
|
||||
this.data = data;
|
||||
setBackground("menubg.png");
|
||||
xSize = 346;
|
||||
ySize = 216;
|
||||
closeOnEsc = true;
|
||||
Client.sendData(EnumPacketServer.DimensionsGet);
|
||||
PacketClient.sendClient(new DimensionsGetPacket());
|
||||
}
|
||||
|
||||
public void initGui(){
|
||||
@@ -34,7 +36,7 @@ public class SubGuiNpcDimensions extends SubGuiInterface implements IScrollData
|
||||
allDimensions.guiTop = guiTop + 14;
|
||||
this.addScroll(allDimensions);
|
||||
addLabel(new GuiNpcLabel(1, "spawning.availableDimensions", guiLeft + 4, guiTop + 4));
|
||||
|
||||
|
||||
if(dataDimensions == null){
|
||||
dataDimensions = new GuiCustomScroll(this,1);
|
||||
dataDimensions.setSize(140, 180);
|
||||
@@ -58,8 +60,8 @@ public class SubGuiNpcDimensions extends SubGuiInterface implements IScrollData
|
||||
|
||||
addButton(new GuiNpcButton(3, guiLeft + 145, guiTop + 90, 55, 20, ">>"));
|
||||
addButton(new GuiNpcButton(4, guiLeft + 145, guiTop + 112, 55, 20, "<<"));
|
||||
|
||||
|
||||
|
||||
|
||||
addButton(new GuiNpcButton(66, guiLeft + 260, guiTop + 194, 60, 20, "gui.done"));
|
||||
}
|
||||
|
||||
@@ -70,14 +72,14 @@ public class SubGuiNpcDimensions extends SubGuiInterface implements IScrollData
|
||||
data.dimensions.add(dimensionMap.get(allDimensions.getSelected()));
|
||||
allDimensions.selected = -1;
|
||||
initGui();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(button.id == 2){
|
||||
if(dataDimensions.hasSelected()){
|
||||
data.dimensions.remove(dimensionMap.get(dataDimensions.getSelected()));
|
||||
dataDimensions.selected = -1;
|
||||
initGui();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(button.id == 3){
|
||||
data.dimensions.clear();
|
||||
|
||||
Reference in new issue
Block a user