Complete Block & Wand Packets

This commit is contained in:
Kam committed 2025-02-02 19:08:18 -05:00
1 parent f314d9d826
commit b0e4d555ce
13 files changed
+267 -64

No files matched your search

@@ -1,5 +1,6 @@
package noppes.npcs.client.gui;
import kamkeel.npcs.network.packets.request.faction.FactionGetPacket;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.nbt.NBTTagCompound;
import noppes.npcs.client.Client;
@@ -11,11 +12,11 @@ import noppes.npcs.constants.EnumPacketServer;
import noppes.npcs.controllers.data.Availability;
import noppes.npcs.controllers.data.Faction;
public class SubGuiNpcAvailability extends SubGuiInterface implements ITextfieldListener, GuiSelectionListener, IGuiData
public class SubGuiNpcAvailability extends SubGuiInterface implements ITextfieldListener, GuiSelectionListener, IGuiData
{
private Availability availabitily;
private int slot = 0;
public SubGuiNpcAvailability(Availability availabitily)
{
this.availabitily = availabitily;
@@ -34,14 +35,14 @@ public class SubGuiNpcAvailability extends SubGuiInterface implements ITextfield
this.addButton(new GuiNpcButton(0, guiLeft + 34, guiTop + 12, 180, 20, "availability.selectdialog"));
this.addButton(new GuiNpcButton(1, guiLeft + 34, guiTop + 35, 180, 20, "availability.selectquest"));
this.addButton(new GuiNpcButton(20, guiLeft + 4, guiTop + 104, 50, 20, new String[]{"availability.always","availability.is","availability.isnot"},availabitily.factionAvailable.ordinal()));
this.addButton(new GuiNpcButton(22, guiLeft + 56, guiTop + 104, 60, 20, new String[]{"faction.friendly","faction.neutral","faction.unfriendly"},availabitily.factionStance.ordinal()));
this.addButton(new GuiNpcButton(21, guiLeft + 118, guiTop + 104, 110, 20, "availability.selectfaction"));
getButton(21).setEnabled(availabitily.factionAvailable != EnumAvailabilityFactionType.Always);
getButton(22).setEnabled(availabitily.factionAvailable != EnumAvailabilityFactionType.Always);
this.addButton(new GuiNpcButton(23, guiLeft + 230, guiTop + 104,20, 20, "X"));
this.addButton(new GuiNpcButton(24, guiLeft + 4, guiTop + 126, 50, 20, new String[]{"availability.always","availability.is","availability.isnot"},availabitily.faction2Available.ordinal()));
this.addButton(new GuiNpcButton(27, guiLeft + 56, guiTop + 126, 60, 20, new String[]{"faction.friendly","faction.neutral","faction.unfriendly"},availabitily.faction2Stance.ordinal()));
this.addButton(new GuiNpcButton(25, guiLeft + 118, guiTop + 126, 110, 20, "availability.selectfaction"));
@@ -56,19 +57,19 @@ public class SubGuiNpcAvailability extends SubGuiInterface implements ITextfield
this.addTextField(new GuiNpcTextField(51, this, fontRendererObj, guiLeft + 50, guiTop + 170,90, 20, availabitily.minPlayerLevel + ""));
this.getTextField(51).integersOnly = true;
this.getTextField(51).setMinMaxDefault(0, Integer.MAX_VALUE, 0);
this.addButton(new GuiNpcButton(66, guiLeft + 82, guiTop + 192,98, 20, "gui.done"));
updateGuiButtons();
}
private void updateGuiButtons() {
if(availabitily.factionId >= 0){
Client.sendData(EnumPacketServer.FactionGet, availabitily.factionId);
FactionGetPacket.getFaction(availabitily.factionId);
}
if(availabitily.faction2Id >= 0){
Client.sendData(EnumPacketServer.FactionGet, availabitily.faction2Id);
FactionGetPacket.getFaction(availabitily.faction2Id);
}
}