mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-26 04:33:04 +00:00
Merge remote-tracking branch 'upstream/packet' into packet
This commit is contained in:
commit
5ce4beab34
29 files changed
+315
-228
No files matched your search
@@ -365,16 +365,7 @@ public class PacketHandlerServer{
|
||||
}
|
||||
|
||||
private void blockPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws IOException {
|
||||
if (type == EnumPacketServer.SaveTileEntity) {
|
||||
NoppesUtilServer.saveTileEntity(player, ByteBufUtils.readNBT(buffer));
|
||||
}
|
||||
else if(type == EnumPacketServer.GetTileEntity){
|
||||
TileEntity tile = player.worldObj.getTileEntity(buffer.readInt(), buffer.readInt(), buffer.readInt());
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
tile.writeToNBT(compound);
|
||||
GuiDataPacket.sendGuiData(player, compound);
|
||||
}
|
||||
else if(type == EnumPacketServer.DialogCategoriesGet){
|
||||
if(type == EnumPacketServer.DialogCategoriesGet){
|
||||
ScrollDataPacket.sendScrollData(player, DialogController.Instance.getScroll());
|
||||
}
|
||||
else if(type == EnumPacketServer.DialogsGetFromDialog){
|
||||
@@ -449,48 +440,7 @@ public class PacketHandlerServer{
|
||||
}
|
||||
|
||||
private void wandPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player, EntityNPCInterface npc) throws IOException{
|
||||
if(type == EnumPacketServer.QuestOpenGui){
|
||||
Quest quest = new Quest();
|
||||
int gui = buffer.readInt();
|
||||
quest.readNBT(ByteBufUtils.readNBT(buffer));
|
||||
NoppesUtilServer.setEditingQuest(player,quest);
|
||||
player.openGui(CustomNpcs.instance, gui , player.worldObj, 0, 0, 0);
|
||||
}
|
||||
else if(type == EnumPacketServer.TraderMarketSave){
|
||||
String market = ByteBufUtils.readString(buffer);
|
||||
if(market == null)
|
||||
return;
|
||||
boolean bo = buffer.readBoolean();
|
||||
if(npc.roleInterface instanceof RoleTrader){
|
||||
if(bo)
|
||||
Market.setMarket(npc, market);
|
||||
else
|
||||
Market.save((RoleTrader)npc.roleInterface, market);
|
||||
}
|
||||
}
|
||||
else if(type == EnumPacketServer.AnimationsGet){
|
||||
NoppesUtilServer.sendAnimationDataAll(player);
|
||||
}
|
||||
else if(type == EnumPacketServer.AnimationGet){
|
||||
Animation animation = (Animation) AnimationController.getInstance().get(buffer.readInt());
|
||||
NBTTagCompound compound = animation.writeToNBT();
|
||||
GuiDataPacket.sendGuiData(player, compound);
|
||||
}
|
||||
else if(type == EnumPacketServer.AnimationRemove){
|
||||
AnimationController.getInstance().delete(buffer.readInt());
|
||||
NoppesUtilServer.sendAnimationDataAll(player);
|
||||
NBTTagCompound compound = (new Animation()).writeToNBT();
|
||||
GuiDataPacket.sendGuiData(player, compound);
|
||||
}
|
||||
else if(type == EnumPacketServer.AnimationSave){
|
||||
Animation animation = new Animation();
|
||||
animation.readFromNBT(ByteBufUtils.readNBT(buffer));
|
||||
AnimationController.getInstance().saveAnimation(animation);
|
||||
NoppesUtilServer.sendAnimationDataAll(player);
|
||||
GuiDataPacket.sendGuiData(player, animation.writeToNBT());
|
||||
}
|
||||
else
|
||||
blockPackets(type, buffer, player);
|
||||
blockPackets(type, buffer, player);
|
||||
}
|
||||
private void mountPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws IOException{
|
||||
if(type == EnumPacketServer.SpawnRider){
|
||||
@@ -652,19 +602,6 @@ public class PacketHandlerServer{
|
||||
compound.setTag("ShortTags", validTagList);
|
||||
GuiDataPacket.sendGuiData(player, compound);
|
||||
}
|
||||
else if (type != EnumPacketServer.NpcTagsGet && type != EnumPacketServer.TagsGet) {
|
||||
warn(player, "WE 2 tried todo something with the wrong tool, probably a hacker");
|
||||
}
|
||||
}
|
||||
|
||||
private void setTags(EntityNPCInterface npc, ByteBuf buffer) throws IOException {
|
||||
npc.advanced.tagUUIDs.removeIf(uuid -> TagController.getInstance().getTagFromUUID(uuid) != null);
|
||||
NBTTagCompound compound = ByteBufUtils.readNBT(buffer);
|
||||
NBTTagList list = compound.getTagList("TagNames",8);
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
String tagName = list.getStringTagAt(i);
|
||||
npc.advanced.tagUUIDs.add(((Tag)TagController.getInstance().getTagFromName(tagName)).uuid);
|
||||
}
|
||||
}
|
||||
|
||||
private void warn(EntityPlayer player, String warning){
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.TileEntityGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.TileEntitySavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.blocks.tiles.TileBorder;
|
||||
@@ -10,27 +13,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,10 +51,10 @@ 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);
|
||||
PacketClient.sendClient(new TileEntitySavePacket(compound));
|
||||
}
|
||||
@Override
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.TileEntitySavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
@@ -14,58 +16,58 @@ import noppes.npcs.constants.EnumPacketServer;
|
||||
public class GuiNpcRedstoneBlock extends GuiNPCInterface{
|
||||
|
||||
private TileRedstoneBlock tile;
|
||||
|
||||
|
||||
public GuiNpcRedstoneBlock(int x, int y, int z) {
|
||||
super();
|
||||
tile = (TileRedstoneBlock) player.worldObj.getTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void initGui(){
|
||||
super.initGui();
|
||||
|
||||
this.addButton(new GuiNpcButton(4, guiLeft + 40, guiTop + 20, 120, 20, "availability.options"));
|
||||
|
||||
addLabel(new GuiNpcLabel(11,"gui.detailed", guiLeft+ 40, guiTop + 47, 0xffffff));
|
||||
addLabel(new GuiNpcLabel(11,"gui.detailed", guiLeft+ 40, guiTop + 47, 0xffffff));
|
||||
this.addButton(new GuiNpcButton(1, guiLeft + 110, guiTop + 42, 50, 20, new String[]{"gui.no", "gui.yes"},tile.isDetailed?1:0));
|
||||
|
||||
|
||||
if(tile.isDetailed){
|
||||
addLabel(new GuiNpcLabel(0,StatCollector.translateToLocal("bard.ondistance") + " X:", guiLeft+ 1, guiTop + 76, 0xffffff));
|
||||
addLabel(new GuiNpcLabel(0,StatCollector.translateToLocal("bard.ondistance") + " X:", guiLeft+ 1, guiTop + 76, 0xffffff));
|
||||
addTextField(new GuiNpcTextField(0, this, fontRendererObj, guiLeft+ 80, guiTop + 71,30,20, tile.onRangeX + ""));
|
||||
getTextField(0).integersOnly = true;
|
||||
getTextField(0).setMinMaxDefault(0, 50, 6);
|
||||
addLabel(new GuiNpcLabel(1,"Y:", guiLeft+ 113, guiTop + 76, 0xffffff));
|
||||
getTextField(0).setMinMaxDefault(0, 50, 6);
|
||||
addLabel(new GuiNpcLabel(1,"Y:", guiLeft+ 113, guiTop + 76, 0xffffff));
|
||||
addTextField(new GuiNpcTextField(1, this, fontRendererObj, guiLeft+ 122, guiTop + 71,30,20, tile.onRangeY + ""));
|
||||
getTextField(1).integersOnly = true;
|
||||
getTextField(1).setMinMaxDefault(0, 50, 6);
|
||||
addLabel(new GuiNpcLabel(2,"Z:", guiLeft+ 155, guiTop + 76, 0xffffff));
|
||||
getTextField(1).setMinMaxDefault(0, 50, 6);
|
||||
addLabel(new GuiNpcLabel(2,"Z:", guiLeft+ 155, guiTop + 76, 0xffffff));
|
||||
addTextField(new GuiNpcTextField(2, this, fontRendererObj, guiLeft+ 164, guiTop + 71,30,20, tile.onRangeZ + ""));
|
||||
getTextField(2).integersOnly = true;
|
||||
getTextField(2).setMinMaxDefault(0, 50, 6);
|
||||
|
||||
addLabel(new GuiNpcLabel(3,StatCollector.translateToLocal("bard.offdistance") + " X:", guiLeft - 3, guiTop + 99, 0xffffff));
|
||||
|
||||
addLabel(new GuiNpcLabel(3,StatCollector.translateToLocal("bard.offdistance") + " X:", guiLeft - 3, guiTop + 99, 0xffffff));
|
||||
addTextField(new GuiNpcTextField(3, this, fontRendererObj, guiLeft+ 80, guiTop + 94,30,20, tile.offRangeX + ""));
|
||||
getTextField(3).integersOnly = true;
|
||||
getTextField(3).setMinMaxDefault(0, 50, 10);
|
||||
addLabel(new GuiNpcLabel(4,"Y:", guiLeft+ 113, guiTop + 99, 0xffffff));
|
||||
getTextField(3).setMinMaxDefault(0, 50, 10);
|
||||
addLabel(new GuiNpcLabel(4,"Y:", guiLeft+ 113, guiTop + 99, 0xffffff));
|
||||
addTextField(new GuiNpcTextField(4, this, fontRendererObj, guiLeft+ 122, guiTop + 94,30,20, tile.offRangeY + ""));
|
||||
getTextField(4).integersOnly = true;
|
||||
getTextField(4).setMinMaxDefault(0, 50, 10);
|
||||
addLabel(new GuiNpcLabel(5,"Z:", guiLeft+ 155, guiTop + 99, 0xffffff));
|
||||
getTextField(4).setMinMaxDefault(0, 50, 10);
|
||||
addLabel(new GuiNpcLabel(5,"Z:", guiLeft+ 155, guiTop + 99, 0xffffff));
|
||||
addTextField(new GuiNpcTextField(5, this, fontRendererObj, guiLeft+ 164, guiTop + 94,30,20, tile.offRangeZ + ""));
|
||||
getTextField(5).integersOnly = true;
|
||||
getTextField(5).setMinMaxDefault(0, 50, 10);
|
||||
}
|
||||
else{
|
||||
addLabel(new GuiNpcLabel(0,"bard.ondistance", guiLeft+ 1, guiTop + 76, 0xffffff));
|
||||
addLabel(new GuiNpcLabel(0,"bard.ondistance", guiLeft+ 1, guiTop + 76, 0xffffff));
|
||||
addTextField(new GuiNpcTextField(0, this, fontRendererObj, guiLeft+ 80, guiTop + 71,30,20, tile.onRange + ""));
|
||||
getTextField(0).integersOnly = true;
|
||||
getTextField(0).setMinMaxDefault(0, 50, 6);
|
||||
|
||||
addLabel(new GuiNpcLabel(3,"bard.offdistance", guiLeft - 3, guiTop + 99, 0xffffff));
|
||||
getTextField(0).setMinMaxDefault(0, 50, 6);
|
||||
|
||||
addLabel(new GuiNpcLabel(3,"bard.offdistance", guiLeft - 3, guiTop + 99, 0xffffff));
|
||||
addTextField(new GuiNpcTextField(3, this, fontRendererObj, guiLeft+ 80, guiTop + 94,30,20, tile.offRange + ""));
|
||||
getTextField(3).integersOnly = true;
|
||||
getTextField(3).setMinMaxDefault(0, 50, 10);
|
||||
getTextField(3).setMinMaxDefault(0, 50, 10);
|
||||
}
|
||||
addButton(new GuiNpcButton(0, guiLeft + 40, guiTop + 190,120,20, "Done"));
|
||||
}
|
||||
@@ -96,7 +98,7 @@ public class GuiNpcRedstoneBlock extends GuiNPCInterface{
|
||||
tile.offRangeX = getTextField(3).getInteger();
|
||||
tile.offRangeY = getTextField(4).getInteger();
|
||||
tile.offRangeZ = getTextField(5).getInteger();
|
||||
|
||||
|
||||
if(tile.onRangeX > tile.offRangeX)
|
||||
tile.offRangeX = tile.onRangeX;
|
||||
if(tile.onRangeY > tile.offRangeY)
|
||||
@@ -111,10 +113,10 @@ public class GuiNpcRedstoneBlock extends GuiNPCInterface{
|
||||
tile.offRange = tile.onRange;
|
||||
}
|
||||
tile.isActivated = false;
|
||||
|
||||
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
tile.writeToNBT(compound);
|
||||
Client.sendData(EnumPacketServer.SaveTileEntity, compound);
|
||||
PacketClient.sendClient(new TileEntitySavePacket(compound));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.TileEntitySavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.blocks.tiles.TileWaypoint;
|
||||
@@ -13,7 +15,7 @@ import noppes.npcs.constants.EnumPacketServer;
|
||||
public class GuiNpcWaypoint extends GuiNPCInterface{
|
||||
|
||||
private TileWaypoint tile;
|
||||
|
||||
|
||||
public GuiNpcWaypoint(int x, int y, int z) {
|
||||
super();
|
||||
tile = (TileWaypoint) player.worldObj.getTileEntity(x, y, z);
|
||||
@@ -23,11 +25,11 @@ public class GuiNpcWaypoint extends GuiNPCInterface{
|
||||
{
|
||||
super.initGui();
|
||||
|
||||
|
||||
addLabel(new GuiNpcLabel(0,"gui.name", guiLeft+ 1, guiTop + 76, 0xffffff));
|
||||
|
||||
addLabel(new GuiNpcLabel(0,"gui.name", guiLeft+ 1, guiTop + 76, 0xffffff));
|
||||
addTextField(new GuiNpcTextField(0, this, fontRendererObj, guiLeft+ 60, guiTop + 71,200,20, tile.name));
|
||||
|
||||
addLabel(new GuiNpcLabel(1,"gui.range", guiLeft+ 1, guiTop + 97, 0xffffff));
|
||||
|
||||
addLabel(new GuiNpcLabel(1,"gui.range", guiLeft+ 1, guiTop + 97, 0xffffff));
|
||||
addTextField(new GuiNpcTextField(1, this, fontRendererObj, guiLeft+ 60, guiTop + 92,200,20, tile.range + ""));
|
||||
getTextField(1).integersOnly = true;
|
||||
getTextField(1).setMinMaxDefault(2, 60, 10);
|
||||
@@ -43,10 +45,10 @@ public class GuiNpcWaypoint extends GuiNPCInterface{
|
||||
public void save() {
|
||||
tile.name = getTextField(0).getText();
|
||||
tile.range = getTextField(1).getInteger();
|
||||
|
||||
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
tile.writeToNBT(compound);
|
||||
Client.sendData(EnumPacketServer.SaveTileEntity, compound);
|
||||
PacketClient.sendClient(new TileEntitySavePacket(compound));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,18 +1,15 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.tags.TagsGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.tags.TagsNpcGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.tags.TagSetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.controllers.TagController;
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -33,8 +30,8 @@ public class SubGuiClonerNPCTags extends SubGuiInterface implements IGuiData,ISc
|
||||
{
|
||||
this.parent = guiNpcMobSpawnerAdd;
|
||||
this.mobSpawnerAdd = guiNpcMobSpawnerAdd;
|
||||
Client.sendData(EnumPacketServer.TagsGet);
|
||||
Client.sendData(EnumPacketServer.NpcTagsGet);
|
||||
PacketClient.sendClient(new TagsGetPacket());
|
||||
PacketClient.sendClient(new TagsNpcGetPacket());
|
||||
setBackground("menubg.png");
|
||||
xSize = 305;
|
||||
ySize = 220;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.quest.QuestOpenGuiPacket;
|
||||
import kamkeel.npcs.network.packets.request.quest.QuestSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -103,7 +104,7 @@ public class SubGuiNpcQuest extends SubGuiInterface implements ISubGuiListener,
|
||||
setSubGui(new SubGuiNpcTextArea(quest.logText));
|
||||
}
|
||||
if(button.id == 5 && quest.id >= 0){
|
||||
Client.sendData(EnumPacketServer.QuestOpenGui, EnumGuiType.QuestReward, quest.writeToNBT(new NBTTagCompound()));
|
||||
PacketClient.sendClient(new QuestOpenGuiPacket(EnumGuiType.QuestReward, quest.writeToNBT(new NBTTagCompound())));
|
||||
}
|
||||
if(button.id == 6 && quest.id >= 0){
|
||||
quest.setType(EnumQuestType.values()[button.getValue()]);
|
||||
@@ -111,7 +112,7 @@ public class SubGuiNpcQuest extends SubGuiInterface implements ISubGuiListener,
|
||||
if(button.id == 7)
|
||||
{
|
||||
if(quest.type == EnumQuestType.Item)
|
||||
Client.sendData(EnumPacketServer.QuestOpenGui, EnumGuiType.QuestItem, quest.writeToNBT(new NBTTagCompound()));
|
||||
PacketClient.sendClient(new QuestOpenGuiPacket(EnumGuiType.QuestItem, quest.writeToNBT(new NBTTagCompound())));
|
||||
|
||||
if(quest.type == EnumQuestType.Dialog)
|
||||
setSubGui(new GuiNpcQuestTypeDialog(npc, quest, this));
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package noppes.npcs.client.gui.advanced;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.tags.TagsGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.tags.TagsNpcGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.tags.TagSetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -28,8 +28,8 @@ public class GuiNPCTagSetup extends GuiNPCInterface2 implements IScrollData,ICus
|
||||
public GuiNPCTagSetup(EntityNPCInterface npc)
|
||||
{
|
||||
super(npc);
|
||||
Client.sendData(EnumPacketServer.TagsGet);
|
||||
Client.sendData(EnumPacketServer.NpcTagsGet);
|
||||
PacketClient.sendClient(new TagsGetPacket());
|
||||
PacketClient.sendClient(new TagsNpcGetPacket());
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package noppes.npcs.client.gui.global;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.animation.AnimationSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.client.Client;
|
||||
@@ -585,7 +587,7 @@ public class GuiNPCEditAnimation extends GuiModelInterface implements ITextfield
|
||||
public void close() {
|
||||
if (!this.hasSubGui()) {
|
||||
if (animation != null) {
|
||||
Client.sendData(EnumPacketServer.AnimationSave, animation.writeToNBT());
|
||||
PacketClient.sendClient(new AnimationSavePacket(animation.writeToNBT()));
|
||||
}
|
||||
displayGuiScreen(parent);
|
||||
} else {
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package noppes.npcs.client.gui.global;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.animation.AnimationGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.animation.AnimationRemovePacket;
|
||||
import kamkeel.npcs.network.packets.request.animation.AnimationSavePacket;
|
||||
import kamkeel.npcs.network.packets.request.animation.AnimationsGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
@@ -33,7 +38,7 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
this.setSave(save);
|
||||
this.xOffset = -148 + 70;
|
||||
this.yOffset = -170 + 137;
|
||||
Client.sendData(EnumPacketServer.AnimationsGet);
|
||||
PacketClient.sendClient(new AnimationsGetPacket());
|
||||
|
||||
AnimationData data = npc.display.animationData;
|
||||
data.setEnabled(true);
|
||||
@@ -164,7 +169,7 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
while(data.containsKey(name))
|
||||
name += "_";
|
||||
Animation animation = new Animation(-1, name);
|
||||
Client.sendData(EnumPacketServer.AnimationSave, animation.writeToNBT());
|
||||
PacketClient.sendClient(new AnimationSavePacket(animation.writeToNBT()));
|
||||
}
|
||||
if(button.id == 1){
|
||||
if(data.containsKey(scrollAnimations.getSelected())) {
|
||||
@@ -234,13 +239,13 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
if(guiCustomScroll.id == 0)
|
||||
{
|
||||
selected = scrollAnimations.getSelected();
|
||||
Client.sendData(EnumPacketServer.AnimationGet, data.get(selected));
|
||||
PacketClient.sendClient(new AnimationGetPacket(data.get(selected)));
|
||||
}
|
||||
}
|
||||
|
||||
public void save() {
|
||||
if(selected != null && data.containsKey(selected) && animation != null){
|
||||
Client.sendData(EnumPacketServer.AnimationSave, animation.writeToNBT());
|
||||
PacketClient.sendClient(new AnimationSavePacket(animation.writeToNBT()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,7 +277,7 @@ public class GuiNPCManageAnimations extends GuiModelInterface2 implements IScrol
|
||||
return;
|
||||
if(id == 1) {
|
||||
if(data.containsKey(scrollAnimations.getSelected())) {
|
||||
Client.sendData(EnumPacketServer.AnimationRemove, data.get(selected));
|
||||
PacketClient.sendClient(new AnimationRemovePacket(data.get(selected)));
|
||||
scrollAnimations.clear();
|
||||
animation = new Animation();
|
||||
initGui();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package noppes.npcs.client.gui.global;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.tags.TagsGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.tags.TagRemovePacket;
|
||||
import kamkeel.npcs.network.packets.request.tags.TagSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
@@ -28,7 +29,7 @@ public class GuiNPCManageTags extends GuiNPCInterface2 implements IScrollData,IC
|
||||
public GuiNPCManageTags(EntityNPCInterface npc)
|
||||
{
|
||||
super(npc);
|
||||
Client.sendData(EnumPacketServer.TagsGet);
|
||||
PacketClient.sendClient(new TagsGetPacket());
|
||||
}
|
||||
|
||||
public void initGui()
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
package noppes.npcs.client.gui.roles;
|
||||
|
||||
import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.TraderMarketSavePacket;
|
||||
import kamkeel.npcs.network.packets.request.role.RoleSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -87,7 +88,7 @@ public class GuiNpcTraderSetup extends GuiContainerNPCInterface2 implements ITex
|
||||
|
||||
@Override
|
||||
public void save() {
|
||||
Client.sendData(EnumPacketServer.TraderMarketSave, role.marketName, false);
|
||||
PacketClient.sendClient(new TraderMarketSavePacket(role.marketName, false));
|
||||
PacketClient.sendClient(new RoleSavePacket(role.writeToNBT(new NBTTagCompound())));
|
||||
}
|
||||
|
||||
@@ -96,8 +97,7 @@ public class GuiNpcTraderSetup extends GuiContainerNPCInterface2 implements ITex
|
||||
String name = guiNpcTextField.getText();
|
||||
if(!name.equalsIgnoreCase(role.marketName)){
|
||||
role.marketName = name;
|
||||
Client.sendData(EnumPacketServer.TraderMarketSave, role.marketName, true);
|
||||
}
|
||||
|
||||
PacketClient.sendClient(new TraderMarketSavePacket(role.marketName, true));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,9 +44,7 @@ public enum EnumPacketServer {
|
||||
|
||||
FactionsGet,
|
||||
FactionGet,
|
||||
TagsGet,
|
||||
TagGet,
|
||||
NpcTagsGet,
|
||||
QuestCategoriesGet,
|
||||
QuestRemove(CustomNpcsPermissions.GLOBAL_QUEST),
|
||||
QuestRewardSave(CustomNpcsPermissions.GLOBAL_QUEST),
|
||||
@@ -56,14 +54,14 @@ public enum EnumPacketServer {
|
||||
SpawnRider(CustomNpcsPermissions.TOOL_MOUNTER),
|
||||
MovingPathSave(CustomNpcsPermissions.TOOL_PATHER,true), MovingPathGet(true),
|
||||
|
||||
AnimationsGet, AnimationGet,
|
||||
AnimationRemove(CustomNpcsPermissions.GLOBAL_ANIMATION), AnimationSave(CustomNpcsPermissions.GLOBAL_ANIMATION),
|
||||
|
||||
QuestOpenGui, QuestLogToServer, PartyLogToServer, UntrackQuest,
|
||||
QuestLogToServer,
|
||||
PartyLogToServer,
|
||||
UntrackQuest,
|
||||
|
||||
QuestGet,
|
||||
SaveTileEntity,
|
||||
DimensionTeleport, GetTileEntity, IsGuiOpen,
|
||||
DimensionTeleport,
|
||||
GetTileEntity,
|
||||
IsGuiOpen,
|
||||
|
||||
SavePartyData, CreateParty, GetPartyData, DisbandParty, KickPlayer, LeavePlayer, PartyInvite, GetPartyInviteList, AcceptInvite,
|
||||
IgnoreInvite, SetPartyLeader, SetPartyQuest,
|
||||
|
||||
Reference in new issue
Block a user