mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 04:57:27 +00:00
Complete Block & Wand Packets
This commit is contained in:
1 parent
f314d9d826
commit
b0e4d555ce
13 files changed
+267
-64
No files matched your search
@@ -28,9 +28,7 @@ import kamkeel.npcs.network.packets.request.customgui.CustomGuiClosePacket;
|
||||
import kamkeel.npcs.network.packets.request.customgui.CustomGuiUnfocusedPacket;
|
||||
import kamkeel.npcs.network.packets.request.customgui.CustomScrollClickPacket;
|
||||
import kamkeel.npcs.network.packets.request.dialog.*;
|
||||
import kamkeel.npcs.network.packets.request.faction.FactionRemovePacket;
|
||||
import kamkeel.npcs.network.packets.request.faction.FactionSavePacket;
|
||||
import kamkeel.npcs.network.packets.request.faction.FactionSetPacket;
|
||||
import kamkeel.npcs.network.packets.request.faction.*;
|
||||
import kamkeel.npcs.network.packets.request.jobs.JobGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.jobs.JobSavePacket;
|
||||
import kamkeel.npcs.network.packets.request.jobs.JobSpawnerAddPacket;
|
||||
@@ -153,6 +151,7 @@ public class PacketHandler {
|
||||
REQUEST_PACKET.registerPacket(new QuestCategorySavePacket());
|
||||
REQUEST_PACKET.registerPacket(new QuestCategoryRemovePacket());
|
||||
REQUEST_PACKET.registerPacket(new QuestCategoryGetPacket());
|
||||
REQUEST_PACKET.registerPacket(new QuestCategoriesGetPacket());
|
||||
|
||||
// Quest Packets
|
||||
REQUEST_PACKET.registerPacket(new QuestOpenGuiPacket());
|
||||
@@ -162,11 +161,14 @@ public class PacketHandler {
|
||||
REQUEST_PACKET.registerPacket(new QuestLogToServerPacket());
|
||||
REQUEST_PACKET.registerPacket(new QuestUntrackPacket());
|
||||
REQUEST_PACKET.registerPacket(new QuestGetPacket());
|
||||
REQUEST_PACKET.registerPacket(new QuestsGetPacket());
|
||||
|
||||
// Faction Packets
|
||||
REQUEST_PACKET.registerPacket(new FactionSavePacket());
|
||||
REQUEST_PACKET.registerPacket(new FactionRemovePacket());
|
||||
REQUEST_PACKET.registerPacket(new FactionSetPacket());
|
||||
REQUEST_PACKET.registerPacket(new FactionGetPacket());
|
||||
REQUEST_PACKET.registerPacket(new FactionsGetPacket());
|
||||
|
||||
// Tag Packets
|
||||
REQUEST_PACKET.registerPacket(new TagsGetPacket());
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package kamkeel.npcs.network.packets.request.faction;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.npcs.network.*;
|
||||
import kamkeel.npcs.network.enums.EnumItemPacketType;
|
||||
import kamkeel.npcs.network.enums.EnumRequestPacket;
|
||||
import kamkeel.npcs.network.packets.data.large.GuiDataPacket;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.controllers.FactionController;
|
||||
import noppes.npcs.controllers.data.Faction;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class FactionGetPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|FactionGet";
|
||||
|
||||
private int factionID;
|
||||
|
||||
public FactionGetPacket() {}
|
||||
|
||||
public FactionGetPacket(int factionID) {
|
||||
this.factionID = factionID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
return EnumRequestPacket.FactionGet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.REQUEST_PACKET;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {
|
||||
out.writeInt(this.factionID);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!PacketUtil.verifyItemPacket(player, EnumItemPacketType.WAND, EnumItemPacketType.BLOCK))
|
||||
return;
|
||||
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
Faction faction = FactionController.getInstance().get(in.readInt());
|
||||
faction.writeNBT(compound);
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, compound);
|
||||
}
|
||||
|
||||
public static void getFaction(int id){
|
||||
PacketClient.sendClient(new FactionGetPacket(id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package kamkeel.npcs.network.packets.request.faction;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.npcs.network.AbstractPacket;
|
||||
import kamkeel.npcs.network.PacketChannel;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
import kamkeel.npcs.network.PacketUtil;
|
||||
import kamkeel.npcs.network.enums.EnumItemPacketType;
|
||||
import kamkeel.npcs.network.enums.EnumRequestPacket;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.controllers.QuestController;
|
||||
import noppes.npcs.controllers.data.QuestCategory;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class FactionsGetPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|FactionsGet";
|
||||
|
||||
public FactionsGetPacket() {}
|
||||
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
return EnumRequestPacket.FactionsGet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.REQUEST_PACKET;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {}
|
||||
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!PacketUtil.verifyItemPacket(player, EnumItemPacketType.WAND, EnumItemPacketType.BLOCK))
|
||||
return;
|
||||
|
||||
NoppesUtilServer.sendFactionDataAll((EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package kamkeel.npcs.network.packets.request.quest;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.npcs.network.AbstractPacket;
|
||||
import kamkeel.npcs.network.PacketChannel;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
import kamkeel.npcs.network.PacketUtil;
|
||||
import kamkeel.npcs.network.enums.EnumItemPacketType;
|
||||
import kamkeel.npcs.network.enums.EnumRequestPacket;
|
||||
import kamkeel.npcs.network.packets.data.large.ScrollDataPacket;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.controllers.DialogController;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class QuestCategoriesGetPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|QuestCategoriesGet";
|
||||
|
||||
public QuestCategoriesGetPacket() {}
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
return EnumRequestPacket.QuestCategoriesGet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.REQUEST_PACKET;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {}
|
||||
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!PacketUtil.verifyItemPacket(player, EnumItemPacketType.WAND, EnumItemPacketType.BLOCK))
|
||||
return;
|
||||
|
||||
NoppesUtilServer.sendQuestCategoryData((EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package kamkeel.npcs.network.packets.request.quest;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import kamkeel.npcs.network.AbstractPacket;
|
||||
import kamkeel.npcs.network.PacketChannel;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
import kamkeel.npcs.network.PacketUtil;
|
||||
import kamkeel.npcs.network.enums.EnumItemPacketType;
|
||||
import kamkeel.npcs.network.enums.EnumRequestPacket;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import noppes.npcs.NoppesUtilServer;
|
||||
import noppes.npcs.controllers.DialogController;
|
||||
import noppes.npcs.controllers.QuestController;
|
||||
import noppes.npcs.controllers.data.QuestCategory;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class QuestsGetPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|QuestsGet";
|
||||
|
||||
private int categoryID;
|
||||
private boolean sendGroup;
|
||||
|
||||
public QuestsGetPacket() {}
|
||||
|
||||
public QuestsGetPacket(int categoryID, boolean send) {
|
||||
this.categoryID = categoryID;
|
||||
this.sendGroup = send;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
return EnumRequestPacket.QuestsGet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.REQUEST_PACKET;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {
|
||||
out.writeInt(this.categoryID);
|
||||
out.writeBoolean(this.sendGroup);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!PacketUtil.verifyItemPacket(player, EnumItemPacketType.WAND, EnumItemPacketType.BLOCK))
|
||||
return;
|
||||
|
||||
QuestCategory category = QuestController.Instance.categories.get(in.readInt());
|
||||
boolean sendGroup = in.readBoolean();
|
||||
if(sendGroup){
|
||||
NoppesUtilServer.sendQuestGroup((EntityPlayerMP) player,category);
|
||||
}
|
||||
else {
|
||||
NoppesUtilServer.sendQuestData((EntityPlayerMP) player,category);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,8 +80,6 @@ public class PacketHandlerServer{
|
||||
clonePackets(type, in, player);
|
||||
else if (item.getItem() == CustomItems.teleporter)
|
||||
featherPackets(type, in, player);
|
||||
else if (item.getItem() == Item.getItemFromBlock(CustomItems.waypoint) || item.getItem() == Item.getItemFromBlock(CustomItems.border) || item.getItem() == Item.getItemFromBlock(CustomItems.redstoneBlock))
|
||||
blockPackets(type, in, player);
|
||||
else if (ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT)) {
|
||||
if (type == EnumPacketServer.EventScriptDataGet || type == EnumPacketServer.EventScriptDataSave)
|
||||
npcEventScriptPackets(type, in, player, npc);
|
||||
@@ -362,37 +360,6 @@ public class PacketHandlerServer{
|
||||
}
|
||||
}
|
||||
|
||||
private void blockPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws IOException {
|
||||
if(type == EnumPacketServer.QuestsGetFromQuest){
|
||||
Quest quest = QuestController.Instance.quests.get(buffer.readInt());
|
||||
if(quest == null)
|
||||
return;
|
||||
NoppesUtilServer.sendQuestData(player,quest.category);
|
||||
}
|
||||
else if(type == EnumPacketServer.QuestCategoriesGet){
|
||||
NoppesUtilServer.sendQuestCategoryData(player);
|
||||
}
|
||||
else if(type == EnumPacketServer.QuestsGet){
|
||||
QuestCategory category = QuestController.Instance.categories.get(buffer.readInt());
|
||||
boolean sendGroup = buffer.readBoolean();
|
||||
if(sendGroup){
|
||||
NoppesUtilServer.sendQuestGroup(player,category);
|
||||
}
|
||||
else {
|
||||
NoppesUtilServer.sendQuestData(player,category);
|
||||
}
|
||||
}
|
||||
else if(type == EnumPacketServer.FactionsGet){
|
||||
NoppesUtilServer.sendFactionDataAll(player);
|
||||
}
|
||||
else if(type == EnumPacketServer.FactionGet){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
Faction faction = FactionController.getInstance().get(buffer.readInt());
|
||||
faction.writeNBT(compound);
|
||||
GuiDataPacket.sendGuiData(player, compound);
|
||||
}
|
||||
}
|
||||
|
||||
private void mountPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws IOException{
|
||||
if(type == EnumPacketServer.SpawnRider){
|
||||
Entity entity = EntityList.createEntityFromNBT(ByteBufUtils.readNBT(buffer), player.worldObj);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.faction.FactionsGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.client.Client;
|
||||
@@ -28,7 +30,7 @@ public class GuiNPCFactionSelection extends GuiNPCInterface implements IScrollDa
|
||||
this.parent = parent;
|
||||
this.factionId = dialog;
|
||||
|
||||
Client.sendData(EnumPacketServer.FactionsGet);
|
||||
PacketClient.sendClient(new FactionsGetPacket());
|
||||
|
||||
if(parent instanceof GuiSelectionListener){
|
||||
listener = (GuiSelectionListener) parent;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.faction.FactionsGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
@@ -15,9 +17,9 @@ public class SubGuiNpcFactionOptions extends SubGuiInterface implements IScrollD
|
||||
private FactionOptions options;
|
||||
private HashMap<String,Integer> data = new HashMap<String,Integer>();
|
||||
private GuiCustomScroll scrollFactions;
|
||||
|
||||
|
||||
private int selected = -1;
|
||||
|
||||
|
||||
public SubGuiNpcFactionOptions(FactionOptions options)
|
||||
{
|
||||
this.options = options;
|
||||
@@ -25,7 +27,7 @@ public class SubGuiNpcFactionOptions extends SubGuiInterface implements IScrollD
|
||||
xSize = 256;
|
||||
ySize = 216;
|
||||
closeOnEsc = true;
|
||||
Client.sendData(EnumPacketServer.FactionsGet);
|
||||
PacketClient.sendClient(new FactionsGetPacket());
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
@@ -42,7 +44,7 @@ public class SubGuiNpcFactionOptions extends SubGuiInterface implements IScrollD
|
||||
addLabel(new GuiNpcLabel(0, "1: ", guiLeft + 4, guiTop + 12));
|
||||
if(data.containsValue(options.factionId)){
|
||||
addLabel(new GuiNpcLabel(1, getFactionName(options.factionId), guiLeft + 12, guiTop + 8));
|
||||
|
||||
|
||||
String label = "";
|
||||
if(options.decreaseFactionPoints)
|
||||
label += StatCollector.translateToLocal("gui.decrease");
|
||||
@@ -69,14 +71,14 @@ public class SubGuiNpcFactionOptions extends SubGuiInterface implements IScrollD
|
||||
addButton(new GuiNpcButton(1, guiLeft + 110, guiTop + 35, 20, 20, "X"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(selected >= 0 && (!data.containsValue(options.faction2Id) || !data.containsValue(options.factionId)) && !options.hasFaction(selected)){
|
||||
addButton(new GuiNpcButton(2, guiLeft + 4, guiTop + 60, 90, 20, new String[]{"gui.increase","gui.decrease"},0));
|
||||
|
||||
|
||||
addTextField(new GuiNpcTextField(1, this, fontRendererObj, guiLeft + 4, guiTop + 82, 110, 20, "10"));
|
||||
getTextField(1).integersOnly = true;
|
||||
getTextField(1).setMinMaxDefault(1, 100000, 10);
|
||||
|
||||
|
||||
addButton(new GuiNpcButton(3, guiLeft + 4, guiTop + 104, 60, 20, "gui.add"));
|
||||
}
|
||||
|
||||
@@ -88,7 +90,7 @@ public class SubGuiNpcFactionOptions extends SubGuiInterface implements IScrollD
|
||||
return s;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
protected void actionPerformed(GuiButton guibutton)
|
||||
{
|
||||
int id = guibutton.id;
|
||||
@@ -135,16 +137,16 @@ public class SubGuiNpcFactionOptions extends SubGuiInterface implements IScrollD
|
||||
String name = scroll.getSelected();
|
||||
this.data = data;
|
||||
scroll.setList(list);
|
||||
|
||||
|
||||
if(name != null)
|
||||
scroll.setSelected(name);
|
||||
|
||||
|
||||
initGui();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelected(String selected) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ 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.faction.FactionsGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.mainmenu.MainmenuAdvancedSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -22,7 +23,7 @@ public class GuiNPCFactionSetup extends GuiNPCInterface2 implements IScrollData,
|
||||
public GuiNPCFactionSetup(EntityNPCInterface npc)
|
||||
{
|
||||
super(npc);
|
||||
Client.sendData(EnumPacketServer.FactionsGet);
|
||||
PacketClient.sendClient(new FactionsGetPacket());
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package noppes.npcs.client.gui.global;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.faction.FactionGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.faction.FactionRemovePacket;
|
||||
import kamkeel.npcs.network.packets.request.faction.FactionSavePacket;
|
||||
import kamkeel.npcs.network.packets.request.faction.FactionsGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
@@ -31,7 +33,7 @@ public class GuiNPCManageFactions extends GuiNPCInterface2 implements IScrollDat
|
||||
public GuiNPCManageFactions(EntityNPCInterface npc)
|
||||
{
|
||||
super(npc);
|
||||
Client.sendData(EnumPacketServer.FactionsGet);
|
||||
PacketClient.sendClient(new FactionsGetPacket());
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
@@ -189,7 +191,7 @@ public class GuiNPCManageFactions extends GuiNPCInterface2 implements IScrollDat
|
||||
{
|
||||
save();
|
||||
selected = scrollFactions.getSelected();
|
||||
Client.sendData(EnumPacketServer.FactionGet, data.get(selected));
|
||||
FactionGetPacket.getFaction(data.get(selected));
|
||||
}
|
||||
else if(guiCustomScroll.id == 1)
|
||||
{
|
||||
|
||||
@@ -49,7 +49,7 @@ public class GuiNPCManageQuest extends GuiNPCInterface2 implements IScrollGroup,
|
||||
super(npc);
|
||||
Instance = this;
|
||||
quest = new Quest();
|
||||
Client.sendData(EnumPacketServer.QuestCategoriesGet);
|
||||
PacketClient.sendClient(new QuestCategoriesGetPacket());
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
@@ -283,7 +283,7 @@ public class GuiNPCManageQuest extends GuiNPCInterface2 implements IScrollGroup,
|
||||
else {
|
||||
category.readNBT(compound);
|
||||
setPrevCatName(category.title);
|
||||
Client.sendData(EnumPacketServer.QuestsGet, category.id, true);
|
||||
PacketClient.sendClient(new QuestsGetPacket(category.id, true));
|
||||
resetQuestList();
|
||||
}
|
||||
initGui();
|
||||
|
||||
@@ -39,9 +39,6 @@ public enum EnumPacketServer {
|
||||
|
||||
FactionsGet,
|
||||
FactionGet,
|
||||
QuestCategoriesGet,
|
||||
QuestsGetFromQuest,
|
||||
QuestsGet,
|
||||
PlayerRider(CustomNpcsPermissions.TOOL_MOUNTER),
|
||||
SpawnRider(CustomNpcsPermissions.TOOL_MOUNTER),
|
||||
MovingPathSave(CustomNpcsPermissions.TOOL_PATHER,true),
|
||||
|
||||
Reference in new issue
Block a user