mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 19:39:07 +00:00
Script Packets
This commit is contained in:
1 parent
04fc429a53
commit
0f948a9d62
89 files changed
+937
-384
No files matched your search
@@ -57,6 +57,7 @@ import kamkeel.npcs.network.packets.request.recipe.RecipesGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.role.RoleCompanionUpdatePacket;
|
||||
import kamkeel.npcs.network.packets.request.role.RoleGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.role.RoleSavePacket;
|
||||
import kamkeel.npcs.network.packets.request.script.*;
|
||||
import kamkeel.npcs.network.packets.request.tags.*;
|
||||
import kamkeel.npcs.network.packets.request.transform.TransformGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.transform.TransformLoadPacket;
|
||||
@@ -109,6 +110,16 @@ public class PacketHandler {
|
||||
REQUEST_PACKET.registerPacket(new NpcClosePacket());
|
||||
REQUEST_PACKET.registerPacket(new NpcDeletePacket());
|
||||
|
||||
// Script Packets
|
||||
REQUEST_PACKET.registerPacket(new BlockScriptPacket());
|
||||
REQUEST_PACKET.registerPacket(new EventScriptPacket());
|
||||
REQUEST_PACKET.registerPacket(new ForgeScriptPacket());
|
||||
REQUEST_PACKET.registerPacket(new GlobalNPCScriptPacket());
|
||||
REQUEST_PACKET.registerPacket(new ItemScriptPacket());
|
||||
REQUEST_PACKET.registerPacket(new NPCScriptPacket());
|
||||
REQUEST_PACKET.registerPacket(new PlayerScriptPacket());
|
||||
REQUEST_PACKET.registerPacket(new ScriptInfoPacket());
|
||||
|
||||
// Cloner Packets
|
||||
REQUEST_PACKET.registerPacket(new CloneListPacket());
|
||||
REQUEST_PACKET.registerPacket(new SpawnMobPacket());
|
||||
|
||||
@@ -196,7 +196,7 @@ public class PacketUtil {
|
||||
}
|
||||
}
|
||||
|
||||
public static void saveScripts(IScriptHandler data, ByteBuf buffer, EntityPlayerMP player) throws IOException {
|
||||
public static void saveScripts(IScriptHandler data, ByteBuf buffer) throws IOException {
|
||||
int tab = buffer.readInt();
|
||||
int totalScripts = buffer.readInt();
|
||||
if (totalScripts == 0) {
|
||||
|
||||
@@ -159,5 +159,5 @@ public enum EnumRequestPacket {
|
||||
CloneAllTagsShort,
|
||||
ClonePreSave,
|
||||
|
||||
EventScript, DimensionTeleport
|
||||
EventScript, PlayerScript, ForgeScript, GlobalNPCScript, ItemScript, BlockScript, NPCScript, ScriptInfo, DimensionTeleport
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package kamkeel.npcs.network.packets.request.script;
|
||||
|
||||
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.PacketClient;
|
||||
import kamkeel.npcs.network.PacketHandler;
|
||||
import kamkeel.npcs.network.enums.EnumRequestPacket;
|
||||
import kamkeel.npcs.network.packets.data.large.GuiDataPacket;
|
||||
import kamkeel.npcs.util.ByteBufUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.blocks.tiles.TileScripted;
|
||||
import noppes.npcs.config.ConfigScript;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.PlayerDataScript;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.item.ScriptCustomItem;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class BlockScriptPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|BlockScript";
|
||||
|
||||
private BlockScriptPacket.Action type;
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
private NBTTagCompound compound;
|
||||
|
||||
public BlockScriptPacket() {}
|
||||
|
||||
public BlockScriptPacket(Action type, int x, int y, int z, NBTTagCompound compound) {
|
||||
this.type = type;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.compound = compound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
return EnumRequestPacket.BlockScript;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.REQUEST_PACKET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomNpcsPermissions.Permission getPermission(){
|
||||
return CustomNpcsPermissions.SCRIPT_BLOCK;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {
|
||||
out.writeInt(type.ordinal());
|
||||
out.writeInt(x);
|
||||
out.writeInt(y);
|
||||
out.writeInt(z);
|
||||
if(type == Action.SAVE){
|
||||
ByteBufUtils.writeNBT(out, this.compound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT))
|
||||
return;
|
||||
|
||||
Action requestedAction = Action.values()[in.readInt()];
|
||||
if(requestedAction == Action.GET){
|
||||
TileEntity tile = player.worldObj.getTileEntity(in.readInt(), in.readInt(), in.readInt());
|
||||
if(!(tile instanceof TileScripted))
|
||||
return;
|
||||
NBTTagCompound compound = ((TileScripted) tile).getNBT(new NBTTagCompound());
|
||||
compound.setTag("Languages", ScriptController.Instance.nbtLanguages());
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, compound);
|
||||
} else {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
return;
|
||||
}
|
||||
TileEntity tile = player.worldObj.getTileEntity(in.readInt(), in.readInt(), in.readInt());
|
||||
if(!(tile instanceof TileScripted))
|
||||
return;
|
||||
TileScripted script = (TileScripted) tile;
|
||||
script.setNBT(ByteBufUtils.readNBT(in));
|
||||
script.lastInited = -1;
|
||||
}
|
||||
}
|
||||
|
||||
public static void Save(int x, int y, int z, NBTTagCompound compound) {
|
||||
PacketClient.sendClient(new BlockScriptPacket(Action.SAVE, x, y, z, compound));
|
||||
}
|
||||
public static void Get(int x, int y, int z) {
|
||||
PacketClient.sendClient(new BlockScriptPacket(Action.GET, x, y, z, new NBTTagCompound()));
|
||||
}
|
||||
|
||||
private enum Action {
|
||||
GET,
|
||||
SAVE
|
||||
}
|
||||
}
|
||||
+23
-12
@@ -1,35 +1,35 @@
|
||||
package kamkeel.npcs.network.packets.request.script;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
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 kamkeel.npcs.network.packets.player.BankActionPacket;
|
||||
import kamkeel.npcs.util.ByteBufUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.controllers.ServerCloneController;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.config.ConfigDebug;
|
||||
import noppes.npcs.config.ConfigScript;
|
||||
import noppes.npcs.controllers.data.DataScript;
|
||||
import noppes.npcs.controllers.data.IScriptHandler;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class EventScript extends AbstractPacket {
|
||||
public final class EventScriptPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|EventScript";
|
||||
|
||||
private EventScript.Action type;
|
||||
private EventScriptPacket.Action type;
|
||||
private int page;
|
||||
private int maxSize;
|
||||
private NBTTagCompound compound;
|
||||
|
||||
public EventScript() {}
|
||||
public EventScriptPacket() {}
|
||||
|
||||
public EventScript(Action type, int page, int maxSize, NBTTagCompound compound) {
|
||||
public EventScriptPacket(Action type, int page, int maxSize, NBTTagCompound compound) {
|
||||
this.type = type;
|
||||
this.page = page;
|
||||
this.maxSize = maxSize;
|
||||
@@ -62,7 +62,9 @@ public final class EventScript extends AbstractPacket {
|
||||
out.writeInt(type.ordinal());
|
||||
|
||||
if(type == Action.SAVE){
|
||||
|
||||
out.writeInt(this.page);
|
||||
out.writeInt(this.maxSize);
|
||||
ByteBufUtils.writeNBT(out, this.compound);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,6 +72,10 @@ public final class EventScript extends AbstractPacket {
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT))
|
||||
return;
|
||||
|
||||
if (!PacketUtil.verifyItemPacket(player, EnumItemPacketType.SCRIPTER))
|
||||
return;
|
||||
|
||||
@@ -78,15 +84,20 @@ public final class EventScript extends AbstractPacket {
|
||||
if(requestedAction == Action.GET){
|
||||
PacketUtil.getScripts(data, (EntityPlayerMP) player);
|
||||
} else {
|
||||
|
||||
PacketUtil.saveScripts(data, in);
|
||||
npc.updateAI = true;
|
||||
npc.script.hasInited = false;
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s SAVED NPC %s (%s, %s, %s) [%s]", "SCRIPTER", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)(npc).posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Save(int id, int maxSize, NBTTagCompound compound) {
|
||||
PacketClient.sendClient(new EventScript(Action.SAVE, id, maxSize, compound));
|
||||
PacketClient.sendClient(new EventScriptPacket(Action.SAVE, id, maxSize, compound));
|
||||
}
|
||||
public static void Get() {
|
||||
PacketClient.sendClient(new EventScript(Action.GET, -1, -1, new NBTTagCompound()));
|
||||
PacketClient.sendClient(new EventScriptPacket(Action.GET, -1, -1, new NBTTagCompound()));
|
||||
}
|
||||
|
||||
private enum Action {
|
||||
@@ -0,0 +1,101 @@
|
||||
package kamkeel.npcs.network.packets.request.script;
|
||||
|
||||
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.util.ByteBufUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.config.ConfigScript;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.ForgeDataScript;
|
||||
import noppes.npcs.controllers.data.IScriptHandler;
|
||||
import noppes.npcs.controllers.data.PlayerDataScript;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class ForgeScriptPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|EventScript";
|
||||
|
||||
private ForgeScriptPacket.Action type;
|
||||
private int page;
|
||||
private int maxSize;
|
||||
private NBTTagCompound compound;
|
||||
|
||||
public ForgeScriptPacket() {}
|
||||
|
||||
public ForgeScriptPacket(Action type, int page, int maxSize, NBTTagCompound compound) {
|
||||
this.type = type;
|
||||
this.page = page;
|
||||
this.maxSize = maxSize;
|
||||
this.compound = compound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
return EnumRequestPacket.ForgeScript;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.REQUEST_PACKET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomNpcsPermissions.Permission getPermission(){
|
||||
return CustomNpcsPermissions.SCRIPT_FORGE;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {
|
||||
out.writeInt(type.ordinal());
|
||||
|
||||
if(type == Action.SAVE){
|
||||
out.writeInt(this.page);
|
||||
out.writeInt(this.maxSize);
|
||||
ByteBufUtils.writeNBT(out, this.compound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT))
|
||||
return;
|
||||
|
||||
if (!PacketUtil.verifyItemPacket(player, EnumItemPacketType.SCRIPTER))
|
||||
return;
|
||||
|
||||
Action requestedAction = Action.values()[in.readInt()];
|
||||
ForgeDataScript data = ScriptController.Instance.forgeScripts;
|
||||
if(requestedAction == Action.GET){
|
||||
PacketUtil.getScripts((IScriptHandler) data, (EntityPlayerMP) player);
|
||||
} else {
|
||||
int tab = in.getInt(in.readerIndex());
|
||||
PacketUtil.saveScripts(data, in);
|
||||
ScriptController.Instance.lastForgeUpdate = System.currentTimeMillis();
|
||||
if(tab == -1)
|
||||
ScriptController.Instance.saveForgeScriptsSync();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Save(int id, int maxSize, NBTTagCompound compound) {
|
||||
PacketClient.sendClient(new ForgeScriptPacket(Action.SAVE, id, maxSize, compound));
|
||||
}
|
||||
public static void Get() {
|
||||
PacketClient.sendClient(new ForgeScriptPacket(Action.GET, -1, -1, new NBTTagCompound()));
|
||||
}
|
||||
|
||||
private enum Action {
|
||||
GET,
|
||||
SAVE
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package kamkeel.npcs.network.packets.request.script;
|
||||
|
||||
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.util.ByteBufUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.config.ConfigScript;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.ForgeDataScript;
|
||||
import noppes.npcs.controllers.data.GlobalNPCDataScript;
|
||||
import noppes.npcs.controllers.data.IScriptHandler;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class GlobalNPCScriptPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|GlobalNPCScript";
|
||||
|
||||
private GlobalNPCScriptPacket.Action type;
|
||||
private int page;
|
||||
private int maxSize;
|
||||
private NBTTagCompound compound;
|
||||
|
||||
public GlobalNPCScriptPacket() {}
|
||||
|
||||
public GlobalNPCScriptPacket(Action type, int page, int maxSize, NBTTagCompound compound) {
|
||||
this.type = type;
|
||||
this.page = page;
|
||||
this.maxSize = maxSize;
|
||||
this.compound = compound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
return EnumRequestPacket.GlobalNPCScript;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.REQUEST_PACKET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomNpcsPermissions.Permission getPermission(){
|
||||
return CustomNpcsPermissions.SCRIPT_GLOBAL;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {
|
||||
out.writeInt(type.ordinal());
|
||||
|
||||
if(type == Action.SAVE){
|
||||
out.writeInt(this.page);
|
||||
out.writeInt(this.maxSize);
|
||||
ByteBufUtils.writeNBT(out, this.compound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT))
|
||||
return;
|
||||
|
||||
if (!PacketUtil.verifyItemPacket(player, EnumItemPacketType.SCRIPTER))
|
||||
return;
|
||||
|
||||
Action requestedAction = Action.values()[in.readInt()];
|
||||
GlobalNPCDataScript data = ScriptController.Instance.globalNpcScripts;
|
||||
if(requestedAction == Action.GET){
|
||||
PacketUtil.getScripts((IScriptHandler) data, (EntityPlayerMP) player);
|
||||
} else {
|
||||
int tab = in.getInt(in.readerIndex());
|
||||
PacketUtil.saveScripts(data,in);
|
||||
ScriptController.Instance.lastGlobalNpcUpdate = System.currentTimeMillis();
|
||||
if(tab == -1)
|
||||
ScriptController.Instance.saveGlobalScriptsSync();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Save(int id, int maxSize, NBTTagCompound compound) {
|
||||
PacketClient.sendClient(new GlobalNPCScriptPacket(Action.SAVE, id, maxSize, compound));
|
||||
}
|
||||
public static void Get() {
|
||||
PacketClient.sendClient(new GlobalNPCScriptPacket(Action.GET, -1, -1, new NBTTagCompound()));
|
||||
}
|
||||
|
||||
private enum Action {
|
||||
GET,
|
||||
SAVE
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package kamkeel.npcs.network.packets.request.script;
|
||||
|
||||
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 kamkeel.npcs.util.ByteBufUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.config.ConfigScript;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.IScriptHandler;
|
||||
import noppes.npcs.controllers.data.PlayerDataScript;
|
||||
import noppes.npcs.scripted.NpcAPI;
|
||||
import noppes.npcs.scripted.item.ScriptCustomItem;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class ItemScriptPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|ItemScript";
|
||||
|
||||
private ItemScriptPacket.Action type;
|
||||
private NBTTagCompound compound;
|
||||
|
||||
public ItemScriptPacket() {}
|
||||
|
||||
public ItemScriptPacket(Action type, NBTTagCompound compound) {
|
||||
this.type = type;
|
||||
this.compound = compound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
return EnumRequestPacket.ItemScript;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.REQUEST_PACKET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomNpcsPermissions.Permission getPermission(){
|
||||
return CustomNpcsPermissions.SCRIPT_ITEM;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {
|
||||
out.writeInt(type.ordinal());
|
||||
|
||||
if(type == Action.SAVE){
|
||||
ByteBufUtils.writeNBT(out, this.compound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT))
|
||||
return;
|
||||
|
||||
Action requestedAction = Action.values()[in.readInt()];
|
||||
if(requestedAction == Action.GET){
|
||||
ScriptCustomItem iw = (ScriptCustomItem) NpcAPI.Instance().getIItemStack(player.getHeldItem());
|
||||
iw.loadScriptData();
|
||||
NBTTagCompound compound = iw.getMCNbt();
|
||||
compound.setTag("Languages", ScriptController.Instance.nbtLanguages());
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, compound);
|
||||
} else {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
NBTTagCompound compound = ByteBufUtils.readNBT(in);
|
||||
ScriptCustomItem wrapper = (ScriptCustomItem) NpcAPI.Instance().getIItemStack(player.getHeldItem());
|
||||
wrapper.setMCNbt(compound);
|
||||
wrapper.saveScriptData();
|
||||
wrapper.loaded = false;
|
||||
wrapper.lastInited = -1;
|
||||
((EntityPlayerMP) player).sendContainerToPlayer(player.inventoryContainer);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Save(NBTTagCompound compound) {
|
||||
PacketClient.sendClient(new ItemScriptPacket(Action.SAVE, compound));
|
||||
}
|
||||
public static void Get() {
|
||||
PacketClient.sendClient(new ItemScriptPacket(Action.GET, new NBTTagCompound()));
|
||||
}
|
||||
|
||||
private enum Action {
|
||||
GET,
|
||||
SAVE
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package kamkeel.npcs.network.packets.request.script;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
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 kamkeel.npcs.util.ByteBufUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.config.ConfigDebug;
|
||||
import noppes.npcs.config.ConfigScript;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.GlobalNPCDataScript;
|
||||
import noppes.npcs.controllers.data.IScriptHandler;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class NPCScriptPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|NPCScript";
|
||||
|
||||
private NPCScriptPacket.Action type;
|
||||
private NBTTagCompound compound;
|
||||
|
||||
public NPCScriptPacket() {}
|
||||
|
||||
public NPCScriptPacket(Action type, NBTTagCompound compound) {
|
||||
this.type = type;
|
||||
this.compound = compound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
return EnumRequestPacket.NPCScript;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.REQUEST_PACKET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomNpcsPermissions.Permission getPermission(){
|
||||
return CustomNpcsPermissions.SCRIPT_NPC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean needsNPC(){
|
||||
return true;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {
|
||||
out.writeInt(type.ordinal());
|
||||
|
||||
if(type == Action.SAVE){
|
||||
ByteBufUtils.writeNBT(out, this.compound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT))
|
||||
return;
|
||||
|
||||
if (!PacketUtil.verifyItemPacket(player, EnumItemPacketType.SCRIPTER))
|
||||
return;
|
||||
|
||||
Action requestedAction = Action.values()[in.readInt()];
|
||||
if(requestedAction == Action.GET){
|
||||
NBTTagCompound compound = npc.script.writeToNBT(new NBTTagCompound());
|
||||
compound.setTag("Languages", ScriptController.Instance.nbtLanguages());
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, compound);
|
||||
} else {
|
||||
npc.script.readFromNBT(ByteBufUtils.readNBT(in));
|
||||
npc.updateAI = true;
|
||||
npc.script.hasInited = false;
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s SAVED NPC %s (%s, %s, %s) [%s]", "SCRIPTER", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)(npc).posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Save(NBTTagCompound compound) {
|
||||
PacketClient.sendClient(new NPCScriptPacket(Action.SAVE, compound));
|
||||
}
|
||||
public static void Get() {
|
||||
PacketClient.sendClient(new NPCScriptPacket(Action.GET, new NBTTagCompound()));
|
||||
}
|
||||
|
||||
private enum Action {
|
||||
GET,
|
||||
SAVE
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package kamkeel.npcs.network.packets.request.script;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
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.util.ByteBufUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.config.ConfigDebug;
|
||||
import noppes.npcs.config.ConfigScript;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.DataScript;
|
||||
import noppes.npcs.controllers.data.IScriptHandler;
|
||||
import noppes.npcs.controllers.data.PlayerDataScript;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class PlayerScriptPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|PlayerScript";
|
||||
|
||||
private PlayerScriptPacket.Action type;
|
||||
private int page;
|
||||
private int maxSize;
|
||||
private NBTTagCompound compound;
|
||||
|
||||
public PlayerScriptPacket() {}
|
||||
|
||||
public PlayerScriptPacket(Action type, int page, int maxSize, NBTTagCompound compound) {
|
||||
this.type = type;
|
||||
this.page = page;
|
||||
this.maxSize = maxSize;
|
||||
this.compound = compound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
return EnumRequestPacket.PlayerScript;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.REQUEST_PACKET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomNpcsPermissions.Permission getPermission(){
|
||||
return CustomNpcsPermissions.SCRIPT_PLAYER;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {
|
||||
out.writeInt(type.ordinal());
|
||||
|
||||
if(type == Action.SAVE){
|
||||
out.writeInt(this.page);
|
||||
out.writeInt(this.maxSize);
|
||||
ByteBufUtils.writeNBT(out, this.compound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT))
|
||||
return;
|
||||
|
||||
if (!PacketUtil.verifyItemPacket(player, EnumItemPacketType.SCRIPTER))
|
||||
return;
|
||||
|
||||
Action requestedAction = Action.values()[in.readInt()];
|
||||
PlayerDataScript data = ScriptController.Instance.playerScripts;
|
||||
if(requestedAction == Action.GET){
|
||||
PacketUtil.getScripts((IScriptHandler) data, (EntityPlayerMP) player);
|
||||
} else {
|
||||
int tab = in.getInt(in.readerIndex());
|
||||
PacketUtil.saveScripts(data, in);
|
||||
ScriptController.Instance.lastPlayerUpdate = System.currentTimeMillis();
|
||||
if(tab == -1)
|
||||
ScriptController.Instance.savePlayerScriptsSync();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Save(int id, int maxSize, NBTTagCompound compound) {
|
||||
PacketClient.sendClient(new PlayerScriptPacket(Action.SAVE, id, maxSize, compound));
|
||||
}
|
||||
public static void Get() {
|
||||
PacketClient.sendClient(new PlayerScriptPacket(Action.GET, -1, -1, new NBTTagCompound()));
|
||||
}
|
||||
|
||||
private enum Action {
|
||||
GET,
|
||||
SAVE
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package kamkeel.npcs.network.packets.request.script;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
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 kamkeel.npcs.util.ByteBufUtils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
import noppes.npcs.LogWriter;
|
||||
import noppes.npcs.config.ConfigDebug;
|
||||
import noppes.npcs.config.ConfigScript;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public final class ScriptInfoPacket extends AbstractPacket {
|
||||
public static String packetName = "Request|NPCScript";
|
||||
|
||||
private ScriptInfoPacket.Action type;
|
||||
private NBTTagCompound compound;
|
||||
|
||||
public ScriptInfoPacket() {}
|
||||
|
||||
public ScriptInfoPacket(Action type, NBTTagCompound compound) {
|
||||
this.type = type;
|
||||
this.compound = compound;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum getType() {
|
||||
return EnumRequestPacket.ScriptInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PacketChannel getChannel() {
|
||||
return PacketHandler.REQUEST_PACKET;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomNpcsPermissions.Permission getPermission(){
|
||||
return CustomNpcsPermissions.SCRIPT_GLOBAL;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {
|
||||
out.writeInt(type.ordinal());
|
||||
|
||||
if(type == Action.SAVE){
|
||||
ByteBufUtils.writeNBT(out, this.compound);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if (!(player instanceof EntityPlayerMP))
|
||||
return;
|
||||
|
||||
if (!ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT))
|
||||
return;
|
||||
|
||||
if (!PacketUtil.verifyItemPacket(player, EnumItemPacketType.SCRIPTER))
|
||||
return;
|
||||
|
||||
Action requestedAction = Action.values()[in.readInt()];
|
||||
if(requestedAction == Action.GET){
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setBoolean("ScriptsEnabled", ConfigScript.ScriptingEnabled);
|
||||
compound.setBoolean("PlayerScriptsEnabled", ConfigScript.GlobalPlayerScripts);
|
||||
compound.setBoolean("GlobalNPCScriptsEnabled", ConfigScript.GlobalNPCScripts);
|
||||
compound.setBoolean("ForgeScriptsEnabled", ConfigScript.GlobalForgeScripts);
|
||||
GuiDataPacket.sendGuiData((EntityPlayerMP) player, compound);
|
||||
} else {
|
||||
NBTTagCompound compound = ByteBufUtils.readNBT(in);
|
||||
ConfigScript.ScriptingEnabled = compound.getBoolean("ScriptsEnabled");
|
||||
ConfigScript.GlobalPlayerScripts = compound.getBoolean("PlayerScriptsEnabled");
|
||||
ConfigScript.GlobalNPCScripts = compound.getBoolean("GlobalNPCScriptsEnabled");
|
||||
ConfigScript.GlobalForgeScripts = compound.getBoolean("ForgeScriptsEnabled");
|
||||
}
|
||||
}
|
||||
|
||||
public static void Save(NBTTagCompound compound) {
|
||||
PacketClient.sendClient(new ScriptInfoPacket(Action.SAVE, compound));
|
||||
}
|
||||
public static void Get() {
|
||||
PacketClient.sendClient(new ScriptInfoPacket(Action.GET, new NBTTagCompound()));
|
||||
}
|
||||
|
||||
private enum Action {
|
||||
GET,
|
||||
SAVE
|
||||
}
|
||||
}
|
||||
@@ -40,165 +40,11 @@ public class PacketHandlerServer{
|
||||
ItemStack item = player.inventory.getCurrentItem();
|
||||
|
||||
EntityNPCInterface npc = NoppesUtilServer.getEditingNpc(player);
|
||||
if(item == null && (type == EnumPacketServer.ScriptPlayerGet || type == EnumPacketServer.ScriptPlayerSave || type == EnumPacketServer.ScriptGlobalNPCGet || type == EnumPacketServer.ScriptGlobalNPCSave || type == EnumPacketServer.ScriptForgeGet || type == EnumPacketServer.ScriptForgeSave))
|
||||
warn(player, "tried to use custom npcs without a tool in hand, probably a hacker");
|
||||
else {
|
||||
if (item != null) {
|
||||
if (ConfigScript.canScript(player, CustomNpcsPermissions.SCRIPT)) {
|
||||
if (type == EnumPacketServer.EventScriptDataGet || type == EnumPacketServer.EventScriptDataSave)
|
||||
npcEventScriptPackets(type, in, player, npc);
|
||||
else if (type == EnumPacketServer.ScriptPlayerGet || type == EnumPacketServer.ScriptPlayerSave)
|
||||
playerScriptPackets(type, in, player);
|
||||
else if (type == EnumPacketServer.ScriptGlobalNPCGet || type == EnumPacketServer.ScriptGlobalNPCSave)
|
||||
npcGlobalScriptPackets(type, in, player);
|
||||
else if (type == EnumPacketServer.ScriptForgeGet || type == EnumPacketServer.ScriptForgeSave)
|
||||
forgeScriptPackets(type, in, player);
|
||||
else if (type == EnumPacketServer.ScriptItemDataGet || type == EnumPacketServer.ScriptItemDataSave)
|
||||
itemScriptPackets(type, in, player);
|
||||
else if (type == EnumPacketServer.ScriptBlockDataGet || type == EnumPacketServer.ScriptBlockDataSave)
|
||||
blockScriptPackets(type, in, player);
|
||||
else if (type == EnumPacketServer.ScriptGlobalGuiDataGet || type == EnumPacketServer.ScriptGlobalGuiDataSave)
|
||||
getScriptsEnabled(type, in, player);
|
||||
else if (item.getItem() == CustomItems.scripter)
|
||||
scriptPackets(type, in, player, npc);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogWriter.error("Error with EnumPacketServer." + type, e);
|
||||
}
|
||||
}
|
||||
|
||||
private void getScriptsEnabled(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws IOException {
|
||||
if (type == EnumPacketServer.ScriptGlobalGuiDataGet) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
compound.setBoolean("ScriptsEnabled", ConfigScript.ScriptingEnabled);
|
||||
compound.setBoolean("PlayerScriptsEnabled", ConfigScript.GlobalPlayerScripts);
|
||||
compound.setBoolean("GlobalNPCScriptsEnabled", ConfigScript.GlobalNPCScripts);
|
||||
compound.setBoolean("ForgeScriptsEnabled", ConfigScript.GlobalForgeScripts);
|
||||
GuiDataPacket.sendGuiData(player, compound);
|
||||
}
|
||||
else if (type == EnumPacketServer.ScriptGlobalGuiDataSave) {
|
||||
NBTTagCompound compound = ByteBufUtils.readNBT(buffer);
|
||||
ConfigScript.ScriptingEnabled = compound.getBoolean("ScriptsEnabled");
|
||||
ConfigScript.GlobalPlayerScripts = compound.getBoolean("PlayerScriptsEnabled");
|
||||
ConfigScript.GlobalNPCScripts = compound.getBoolean("GlobalNPCScriptsEnabled");
|
||||
ConfigScript.GlobalForgeScripts = compound.getBoolean("ForgeScriptsEnabled");
|
||||
}
|
||||
}
|
||||
|
||||
private void scriptPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player, EntityNPCInterface npc) throws Exception {
|
||||
if(type == EnumPacketServer.ScriptDataSave){
|
||||
npc.script.readFromNBT(ByteBufUtils.readNBT(buffer));
|
||||
npc.updateAI = true;
|
||||
npc.script.hasInited = false;
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s SAVED NPC %s (%s, %s, %s) [%s]", "SCRIPTER", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)(npc).posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
|
||||
}
|
||||
}
|
||||
else if(type == EnumPacketServer.ScriptDataGet){
|
||||
NBTTagCompound compound = npc.script.writeToNBT(new NBTTagCompound());
|
||||
compound.setTag("Languages", ScriptController.Instance.nbtLanguages());
|
||||
GuiDataPacket.sendGuiData(player, compound);
|
||||
}
|
||||
}
|
||||
|
||||
private void npcEventScriptPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player, EntityNPCInterface npc) throws Exception {
|
||||
DataScript data = npc.script;
|
||||
if(type == EnumPacketServer.EventScriptDataGet) {
|
||||
PacketUtil.getScripts(data,buffer,player);
|
||||
} else if(type == EnumPacketServer.EventScriptDataSave) {
|
||||
PacketUtil.saveScripts(data,buffer,player);
|
||||
npc.updateAI = true;
|
||||
npc.script.hasInited = false;
|
||||
if(ConfigDebug.PlayerLogging && FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER){
|
||||
LogWriter.script(String.format("[%s] (Player) %s SAVED NPC %s (%s, %s, %s) [%s]", "SCRIPTER", player.getCommandSenderName(), npc.display.getName(), (int)npc.posX, (int)(npc).posY, (int)npc.posZ, npc.worldObj.getWorldInfo().getWorldName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void playerScriptPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws Exception {
|
||||
PlayerDataScript data = ScriptController.Instance.playerScripts;
|
||||
if(type == EnumPacketServer.ScriptPlayerGet) {
|
||||
PacketUtil.getScripts(data,buffer,player);
|
||||
} else if(type == EnumPacketServer.ScriptPlayerSave) {
|
||||
int tab = buffer.getInt(buffer.readerIndex());
|
||||
PacketUtil.saveScripts(data,buffer,player);
|
||||
ScriptController.Instance.lastPlayerUpdate = System.currentTimeMillis();
|
||||
if(tab == -1)
|
||||
ScriptController.Instance.savePlayerScriptsSync();
|
||||
}
|
||||
}
|
||||
|
||||
private void forgeScriptPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws Exception {
|
||||
ForgeDataScript data = ScriptController.Instance.forgeScripts;
|
||||
if (type == EnumPacketServer.ScriptForgeGet) {
|
||||
PacketUtil.getScripts(data,buffer,player);
|
||||
} else if (type == EnumPacketServer.ScriptForgeSave) {
|
||||
int tab = buffer.getInt(buffer.readerIndex());
|
||||
PacketUtil.saveScripts(data,buffer,player);
|
||||
ScriptController.Instance.lastForgeUpdate = System.currentTimeMillis();
|
||||
if(tab == -1)
|
||||
ScriptController.Instance.saveForgeScriptsSync();
|
||||
}
|
||||
}
|
||||
|
||||
private void npcGlobalScriptPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws Exception {
|
||||
GlobalNPCDataScript data = ScriptController.Instance.globalNpcScripts;
|
||||
if(type == EnumPacketServer.ScriptGlobalNPCGet) {
|
||||
PacketUtil.getScripts(data,buffer,player);
|
||||
} else if(type == EnumPacketServer.ScriptGlobalNPCSave) {
|
||||
int tab = buffer.getInt(buffer.readerIndex());
|
||||
PacketUtil.saveScripts(data,buffer,player);
|
||||
ScriptController.Instance.lastGlobalNpcUpdate = System.currentTimeMillis();
|
||||
if(tab == -1)
|
||||
ScriptController.Instance.saveGlobalScriptsSync();
|
||||
}
|
||||
}
|
||||
|
||||
private void itemScriptPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws Exception {
|
||||
if (type == EnumPacketServer.ScriptItemDataGet) {
|
||||
ScriptCustomItem iw = (ScriptCustomItem) NpcAPI.Instance().getIItemStack(player.getHeldItem());
|
||||
iw.loadScriptData();
|
||||
NBTTagCompound compound = iw.getMCNbt();
|
||||
compound.setTag("Languages", ScriptController.Instance.nbtLanguages());
|
||||
GuiDataPacket.sendGuiData(player, compound);
|
||||
} else if (type == EnumPacketServer.ScriptItemDataSave) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
return;
|
||||
}
|
||||
|
||||
NBTTagCompound compound = ByteBufUtils.readNBT(buffer);
|
||||
ScriptCustomItem wrapper = (ScriptCustomItem) NpcAPI.Instance().getIItemStack(player.getHeldItem());
|
||||
wrapper.setMCNbt(compound);
|
||||
wrapper.saveScriptData();
|
||||
wrapper.loaded = false;
|
||||
wrapper.lastInited = -1;
|
||||
player.sendContainerToPlayer(player.inventoryContainer);
|
||||
}
|
||||
}
|
||||
|
||||
private void blockScriptPackets(EnumPacketServer type, ByteBuf buffer, EntityPlayerMP player) throws Exception {
|
||||
if (type == EnumPacketServer.ScriptBlockDataGet) {
|
||||
TileEntity tile = player.worldObj.getTileEntity(buffer.readInt(), buffer.readInt(), buffer.readInt());
|
||||
if(!(tile instanceof TileScripted))
|
||||
return;
|
||||
NBTTagCompound compound = ((TileScripted) tile).getNBT(new NBTTagCompound());
|
||||
compound.setTag("Languages", ScriptController.Instance.nbtLanguages());
|
||||
GuiDataPacket.sendGuiData(player, compound);
|
||||
} else if (type == EnumPacketServer.ScriptBlockDataSave) {
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
return;
|
||||
}
|
||||
TileEntity tile = player.worldObj.getTileEntity(buffer.readInt(), buffer.readInt(), buffer.readInt());
|
||||
if(!(tile instanceof TileScripted))
|
||||
return;
|
||||
TileScripted script = (TileScripted) tile;
|
||||
script.setNBT(ByteBufUtils.readNBT(buffer));
|
||||
script.lastInited = -1;
|
||||
}
|
||||
}
|
||||
|
||||
private void warn(EntityPlayer player, String warning){
|
||||
MinecraftServer.getServer().logWarning(player.getCommandSenderName() + ": " + warning);
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.Server;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
@@ -6,9 +6,8 @@ import kamkeel.npcs.network.packets.request.TileEntitySavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.blocks.tiles.TileBorder;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
public class GuiBorderBlock extends GuiNPCInterface implements IGuiData{
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.village.MerchantRecipe;
|
||||
import net.minecraft.village.MerchantRecipeList;
|
||||
import noppes.npcs.ServerEventsHandler;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.CustomNpcResourceListener;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.containers.ContainerMerchantAdd;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
@@ -4,10 +4,10 @@ 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;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ import kamkeel.npcs.network.packets.request.mainmenu.MainmenuAdvancedGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.mainmenu.MainmenuAdvancedSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.select.GuiSoundSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Line;
|
||||
import noppes.npcs.controllers.data.Lines;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -5,13 +5,13 @@ import kamkeel.npcs.network.packets.request.transport.TransportCategoriesGetPack
|
||||
import kamkeel.npcs.network.packets.request.transport.TransportCategorySavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class GuiNPCTransportCategoryEdit extends GuiNPCInterface
|
||||
|
||||
@@ -6,10 +6,10 @@ import kamkeel.npcs.network.packets.request.feather.DimensionTeleportPacket;
|
||||
import kamkeel.npcs.network.packets.request.npc.RemoteDeletePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
@@ -11,11 +11,11 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.controllers.ClientCloneController;
|
||||
import noppes.npcs.client.controllers.ClientTagMapController;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.controllers.data.TagMap;
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.nbt.NBTTagString;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.controllers.ClientCloneController;
|
||||
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;
|
||||
|
||||
@@ -12,10 +12,10 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagDouble;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.controllers.ClientCloneController;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -6,10 +6,10 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagDouble;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.controllers.ClientCloneController;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -7,12 +7,12 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.DataAI;
|
||||
import noppes.npcs.NBTTags;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.GuiCustomScroll;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.IGuiData;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -6,12 +6,12 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.blocks.tiles.TileRedstoneBlock;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
public class GuiNpcRedstoneBlock extends GuiNPCInterface{
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -5,12 +5,12 @@ import kamkeel.npcs.network.packets.request.TileEntitySavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.blocks.tiles.TileWaypoint;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
public class GuiNpcWaypoint extends GuiNPCInterface{
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package noppes.npcs.client.gui;
|
||||
|
||||
import kamkeel.npcs.network.packets.request.script.NPCScriptPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiConfirmOpenLink;
|
||||
import net.minecraft.client.gui.GuiYesNo;
|
||||
@@ -9,11 +10,11 @@ import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.NoppesStringUtils;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.script.GuiNPCEventScripts;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.ScriptContainer;
|
||||
import noppes.npcs.controllers.ScriptController;
|
||||
import noppes.npcs.controllers.data.DataScript;
|
||||
@@ -38,7 +39,7 @@ public class GuiScript extends GuiNPCInterface implements IGuiData, GuiYesNoCall
|
||||
xSize = 420;
|
||||
|
||||
setBackground("menubg.png");
|
||||
Client.sendData(EnumPacketServer.ScriptDataGet);
|
||||
NPCScriptPacket.Get();
|
||||
}
|
||||
|
||||
public void initGui() {
|
||||
@@ -267,7 +268,7 @@ public class GuiScript extends GuiNPCInterface implements IGuiData, GuiYesNoCall
|
||||
@Override
|
||||
public void save() {
|
||||
setScript();
|
||||
Client.sendData(EnumPacketServer.ScriptDataSave, script.writeToNBT(new NBTTagCompound()));
|
||||
NPCScriptPacket.Save(script.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,11 +5,11 @@ import kamkeel.npcs.network.packets.request.MailOpenSetupPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.player.GuiMailmanWrite;
|
||||
import noppes.npcs.client.gui.select.GuiQuestSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.containers.ContainerMail;
|
||||
import noppes.npcs.controllers.data.PlayerMail;
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@ 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;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumAvailabilityFactionType;
|
||||
import noppes.npcs.constants.EnumDayTime;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Availability;
|
||||
import noppes.npcs.controllers.data.Faction;
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ package noppes.npcs.client.gui;
|
||||
import kamkeel.npcs.network.packets.request.dialog.DialogGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.select.GuiDialogSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumAvailabilityDialog;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Availability;
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ package noppes.npcs.client.gui;
|
||||
import kamkeel.npcs.network.packets.request.quest.QuestGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.select.GuiQuestSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumAvailabilityQuest;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Availability;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.dialog.DialogSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.EntityUtil;
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageDialogs;
|
||||
@@ -12,7 +12,7 @@ import noppes.npcs.client.gui.player.GuiDialogInteract;
|
||||
import noppes.npcs.client.gui.select.GuiQuestSelection;
|
||||
import noppes.npcs.client.gui.select.GuiSoundSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.PlayerMail;
|
||||
import noppes.npcs.entity.EntityDialogNpc;
|
||||
|
||||
@@ -3,11 +3,11 @@ package noppes.npcs.client.gui;
|
||||
import kamkeel.npcs.network.packets.request.dialog.DialogGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.select.GuiDialogSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumOptionType;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.DialogOption;
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.dialog.DialogSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.DialogImage;
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@ 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.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.SpawnData;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -4,9 +4,9 @@ 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;
|
||||
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.FactionOptions;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -5,7 +5,7 @@ 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;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.global.GuiNPCManageQuest;
|
||||
import noppes.npcs.client.gui.questtypes.GuiNpcQuestTypeDialog;
|
||||
import noppes.npcs.client.gui.questtypes.GuiNpcQuestTypeKill;
|
||||
|
||||
@@ -5,9 +5,9 @@ import kamkeel.npcs.network.packets.request.linked.LinkedGetAllPacket;
|
||||
import kamkeel.npcs.network.packets.request.linked.LinkedSetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
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;
|
||||
|
||||
@@ -7,10 +7,10 @@ import kamkeel.npcs.network.packets.request.dialog.DialogNpcSetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.select.GuiDialogSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.DialogOption;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@ 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;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.SubGuiNpcFactionOptions;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -4,14 +4,14 @@ import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.mainmenu.MainmenuAdvancedSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.GuiNPCLinesEdit;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface2;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButtonYesNo;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class GuiNPCLinesMenu extends GuiNPCInterface2 {
|
||||
|
||||
@@ -4,11 +4,11 @@ import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.mainmenu.MainmenuAdvancedGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.mainmenu.MainmenuAdvancedMarkDataPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.SubGuiColorSelector;
|
||||
import noppes.npcs.client.gui.SubGuiNpcAvailability;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.constants.MarkType;
|
||||
import noppes.npcs.controllers.data.MarkData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -6,12 +6,12 @@ import kamkeel.npcs.network.packets.request.transform.TransformLoadPacket;
|
||||
import kamkeel.npcs.network.packets.request.transform.TransformSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface2;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.IGuiData;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.DataTransform;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -4,10 +4,10 @@ import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.mainmenu.MainmenuAdvancedSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.select.GuiSoundSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class GuiNPCSoundsMenu extends GuiNPCInterface2 implements ITextfieldListener, ISubGuiListener
|
||||
|
||||
@@ -25,7 +25,7 @@ import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.api.gui.ICustomGuiComponent;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.custom.components.*;
|
||||
import noppes.npcs.client.gui.custom.interfaces.IClickListener;
|
||||
import noppes.npcs.client.gui.custom.interfaces.IDataHolder;
|
||||
@@ -33,7 +33,7 @@ import noppes.npcs.client.gui.custom.interfaces.IGuiComponent;
|
||||
import noppes.npcs.client.gui.util.GuiCustomScroll;
|
||||
import noppes.npcs.client.gui.util.ICustomScrollListener;
|
||||
import noppes.npcs.client.gui.util.IGuiData;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.containers.ContainerCustomGui;
|
||||
import noppes.npcs.scripted.gui.*;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
@@ -4,13 +4,13 @@ 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;
|
||||
|
||||
import noppes.npcs.client.gui.SubGuiAnimationFrame;
|
||||
import noppes.npcs.client.gui.SubGuiAnimationOptions;
|
||||
import noppes.npcs.client.gui.SubGuiColorSelector;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumAnimationPart;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Animation;
|
||||
import noppes.npcs.controllers.data.AnimationData;
|
||||
import noppes.npcs.controllers.data.Frame;
|
||||
|
||||
@@ -10,10 +10,10 @@ import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.*;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ import kamkeel.npcs.network.packets.request.bank.BankSavePacket;
|
||||
import kamkeel.npcs.network.packets.request.bank.BanksGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.CustomNpcResourceListener;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.containers.ContainerManageBanks;
|
||||
import noppes.npcs.controllers.data.Bank;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -7,12 +7,12 @@ import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.SubGuiEditText;
|
||||
import noppes.npcs.client.gui.SubGuiNpcDialog;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.DialogCategory;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -10,12 +10,12 @@ import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.SubGuiColorSelector;
|
||||
import noppes.npcs.client.gui.SubGuiNpcFactionPoints;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Faction;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -6,10 +6,10 @@ import kamkeel.npcs.network.packets.request.linked.LinkedGetAllPacket;
|
||||
import kamkeel.npcs.network.packets.request.linked.LinkedRemovePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.SubGuiEditText;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -8,12 +8,12 @@ import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.SubGuiEditText;
|
||||
import noppes.npcs.client.gui.SubGuiNpcQuest;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Dialog;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.controllers.data.QuestCategory;
|
||||
|
||||
@@ -7,10 +7,10 @@ import kamkeel.npcs.network.packets.request.tags.TagRemovePacket;
|
||||
import kamkeel.npcs.network.packets.request.tags.TagSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.SubGuiColorSelector;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Tag;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import kamkeel.npcs.network.packets.request.transport.TransportCategoryRemovePac
|
||||
import kamkeel.npcs.network.packets.request.transport.TransportRemovePacket;
|
||||
import kamkeel.npcs.network.packets.request.transport.TransportsGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.GuiNPCTransportCategoryEdit;
|
||||
import noppes.npcs.client.gui.mainmenu.GuiNPCGlobalMainMenu;
|
||||
@@ -14,7 +14,7 @@ import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNPCStringSlot;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.IScrollData;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@@ -7,9 +7,9 @@ import kamkeel.npcs.network.packets.request.playerdata.PlayerDataRemovePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.constants.EnumPlayerData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@ import kamkeel.npcs.network.packets.request.recipe.RecipesGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.containers.ContainerManageRecipes;
|
||||
import noppes.npcs.controllers.data.RecipeCarpentry;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -8,13 +8,13 @@ import kamkeel.npcs.network.packets.request.naturalspawns.NaturalSpawnSavePacket
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.GuiNpcMobSpawnerSelector;
|
||||
import noppes.npcs.client.gui.SubGuiNpcBiomes;
|
||||
import noppes.npcs.client.gui.SubGuiNpcDimensions;
|
||||
import noppes.npcs.client.gui.SubGuiSpawningOptions;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.SpawnData;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ import net.minecraft.client.renderer.entity.RenderManager;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.containers.ContainerNPCInv;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -6,12 +6,12 @@ import kamkeel.npcs.network.packets.request.mainmenu.MainmenuAISavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.DataAI;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.SubGuiNpcMovement;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumCombatPolicy;
|
||||
import noppes.npcs.constants.EnumNavType;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class GuiNpcAI extends GuiNPCInterface2 implements ITextfieldListener, IGuiData{
|
||||
|
||||
@@ -8,7 +8,7 @@ import kamkeel.npcs.network.packets.request.role.RoleGetPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.NoppesStringUtils;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.advanced.*;
|
||||
import noppes.npcs.client.gui.roles.*;
|
||||
@@ -17,7 +17,7 @@ import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.IGuiData;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumJobType;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.constants.EnumRoleType;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -8,14 +8,14 @@ import kamkeel.npcs.network.packets.request.mainmenu.MainmenuDisplaySavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.DataDisplay;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.client.gui.*;
|
||||
import noppes.npcs.client.gui.model.GuiCreationScreen;
|
||||
import noppes.npcs.client.gui.select.GuiTextureSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.config.ConfigMain;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.SkinOverlay;
|
||||
import noppes.npcs.entity.EntityCustomNpc;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
@@ -8,10 +8,10 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.EnumCreatureAttribute;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.DataStats;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.*;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
public class GuiNpcStats extends GuiNPCInterface2 implements ITextfieldListener, IGuiData{
|
||||
|
||||
@@ -16,10 +16,10 @@ import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagByte;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.compat.PixelmonHelper;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.*;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
@@ -14,11 +14,11 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.NoppesUtilPlayer;
|
||||
import noppes.npcs.QuestLogData;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import noppes.npcs.client.CustomNpcResourceListener;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.constants.EnumPlayerPacket;
|
||||
import noppes.npcs.controllers.data.Party;
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
|
||||
@@ -17,7 +17,7 @@ import noppes.npcs.NoppesUtilPlayer;
|
||||
import noppes.npcs.QuestLogData;
|
||||
import noppes.npcs.client.*;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.constants.EnumPlayerPacket;
|
||||
import noppes.npcs.controllers.data.Party;
|
||||
import noppes.npcs.util.ValueUtil;
|
||||
|
||||
@@ -8,14 +8,14 @@ import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.ClientCacheHandler;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
import noppes.npcs.client.gui.util.ITextfieldListener;
|
||||
import noppes.npcs.config.ConfigClient;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import tconstruct.client.tabs.AbstractTab;
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ import kamkeel.npcs.network.packets.request.quest.QuestDialogGetTitlePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.select.GuiDialogSelection;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiSelectionListener;
|
||||
import noppes.npcs.client.gui.util.IGuiData;
|
||||
import noppes.npcs.client.gui.util.SubGuiInterface;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Quest;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.quests.QuestDialog;
|
||||
|
||||
@@ -6,12 +6,12 @@ import kamkeel.npcs.network.packets.request.bank.BanksGetPacket;
|
||||
import kamkeel.npcs.network.packets.request.role.RoleSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.GuiCustomScroll;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface2;
|
||||
import noppes.npcs.client.gui.util.ICustomScrollListener;
|
||||
import noppes.npcs.client.gui.util.IScrollData;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.Bank;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleBank;
|
||||
|
||||
@@ -4,11 +4,11 @@ import kamkeel.npcs.network.PacketClient;
|
||||
import kamkeel.npcs.network.packets.request.jobs.JobSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.controllers.MusicController;
|
||||
import noppes.npcs.client.gui.select.GuiSoundSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobBard;
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ import kamkeel.npcs.network.packets.request.role.RoleCompanionUpdatePacket;
|
||||
import kamkeel.npcs.network.packets.request.role.RoleSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.player.companion.GuiNpcCompanionTalents.GuiTalent;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumCompanionStage;
|
||||
import noppes.npcs.constants.EnumCompanionTalent;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleCompanion;
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ package noppes.npcs.client.gui.roles;
|
||||
import kamkeel.npcs.network.packets.request.jobs.JobSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.SubGuiNpcAvailability;
|
||||
import noppes.npcs.client.gui.select.GuiQuestSelection;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobConversation;
|
||||
import noppes.npcs.roles.JobConversation.ConversationLine;
|
||||
|
||||
@@ -2,9 +2,9 @@ package noppes.npcs.client.gui.roles;
|
||||
|
||||
import kamkeel.npcs.network.packets.request.jobs.JobSavePacket;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobFollower;
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.containers.ContainerNPCFollowerSetup;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleFollower;
|
||||
|
||||
@@ -5,12 +5,12 @@ import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.GuiCustomScroll;
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface2;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobGuard;
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ package noppes.npcs.client.gui.roles;
|
||||
|
||||
import kamkeel.npcs.network.packets.request.jobs.JobSavePacket;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface2;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobHealer;
|
||||
|
||||
|
||||
@@ -3,13 +3,13 @@ package noppes.npcs.client.gui.roles;
|
||||
import kamkeel.npcs.network.packets.request.jobs.JobSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.SubGuiNpcAvailability;
|
||||
import noppes.npcs.client.gui.util.GuiContainerNPCInterface2;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.GuiNpcLabel;
|
||||
import noppes.npcs.client.gui.util.GuiNpcTextField;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.containers.ContainerNpcItemGiver;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobItemGiver;
|
||||
|
||||
@@ -7,10 +7,10 @@ import kamkeel.npcs.network.packets.request.jobs.JobSpawnerRemovePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.GuiNpcMobSpawnerSelector;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.JobSpawner;
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ import kamkeel.npcs.network.packets.request.role.RoleSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.CustomNpcResourceListener;
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.containers.ContainerNPCTraderSetup;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import noppes.npcs.roles.RoleTrader;
|
||||
|
||||
@@ -6,9 +6,9 @@ import kamkeel.npcs.network.packets.request.transport.TransportGetLocationPacket
|
||||
import kamkeel.npcs.network.packets.request.transport.TransportSavePacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.*;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.controllers.data.TransportLocation;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package noppes.npcs.client.gui.script;
|
||||
|
||||
import kamkeel.npcs.network.packets.request.script.EventScriptPacket;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.NBTTags;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
import noppes.npcs.controllers.ScriptContainer;
|
||||
import noppes.npcs.controllers.data.DataScript;
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
@@ -36,7 +35,7 @@ public class GuiNPCEventScripts extends GuiScriptInterface {
|
||||
|
||||
this.script = new DataScript(npc);
|
||||
this.handler = this.script;
|
||||
Client.sendData(EnumPacketServer.EventScriptDataGet);
|
||||
EventScriptPacket.Get();
|
||||
}
|
||||
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
@@ -63,12 +62,12 @@ public class GuiNPCEventScripts extends GuiScriptInterface {
|
||||
List<ScriptContainer> containers = this.script.getScripts();
|
||||
for (int i = 0; i < containers.size(); i++) {
|
||||
ScriptContainer container = containers.get(i);
|
||||
Client.sendData(EnumPacketServer.EventScriptDataSave, i, containers.size(), container.writeToNBT(new NBTTagCompound()));
|
||||
EventScriptPacket.Save(i, containers.size(), container.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
NBTTagCompound scriptData = new NBTTagCompound();
|
||||
scriptData.setString("ScriptLanguage", this.script.getLanguage());
|
||||
scriptData.setBoolean("ScriptEnabled", this.script.getEnabled());
|
||||
scriptData.setTag("ScriptConsole", NBTTags.NBTLongStringMap(this.script.getConsoleText()));
|
||||
Client.sendData(EnumPacketServer.EventScriptDataSave, -1, containers.size(), scriptData);
|
||||
EventScriptPacket.Save(-1, containers.size(), scriptData);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package noppes.npcs.client.gui.script;
|
||||
|
||||
import kamkeel.npcs.network.packets.request.script.GlobalNPCScriptPacket;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.NBTTags;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
import noppes.npcs.controllers.ScriptContainer;
|
||||
import noppes.npcs.controllers.data.GlobalNPCDataScript;
|
||||
|
||||
@@ -32,7 +33,7 @@ public class GuiScriptAllNPCs extends GuiScriptInterface {
|
||||
hookList.add("projectileImpact");
|
||||
|
||||
this.handler = this.script;
|
||||
Client.sendData(EnumPacketServer.ScriptGlobalNPCGet);
|
||||
GlobalNPCScriptPacket.Get();
|
||||
}
|
||||
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
@@ -59,12 +60,12 @@ public class GuiScriptAllNPCs extends GuiScriptInterface {
|
||||
List<ScriptContainer> containers = this.script.getScripts();
|
||||
for (int i = 0; i < containers.size(); i++) {
|
||||
ScriptContainer container = containers.get(i);
|
||||
Client.sendData(EnumPacketServer.ScriptGlobalNPCSave, i, containers.size(), container.writeToNBT(new NBTTagCompound()));
|
||||
GlobalNPCScriptPacket.Save(i, containers.size(), container.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
NBTTagCompound scriptData = new NBTTagCompound();
|
||||
scriptData.setString("ScriptLanguage", this.script.getLanguage());
|
||||
scriptData.setBoolean("ScriptEnabled", this.script.getEnabled());
|
||||
scriptData.setTag("ScriptConsole", NBTTags.NBTLongStringMap(this.script.getConsoleText()));
|
||||
Client.sendData(EnumPacketServer.ScriptGlobalNPCSave, -1, containers.size(), scriptData);
|
||||
GlobalNPCScriptPacket.Save(-1, containers.size(), scriptData);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package noppes.npcs.client.gui.script;
|
||||
|
||||
import kamkeel.npcs.network.packets.request.script.BlockScriptPacket;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.blocks.tiles.TileScripted;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
|
||||
public class GuiScriptBlock extends GuiScriptInterface {
|
||||
private TileScripted tileScripted;
|
||||
@@ -24,7 +25,7 @@ public class GuiScriptBlock extends GuiScriptInterface {
|
||||
hookList.add("timer");
|
||||
|
||||
this.handler = this.tileScripted = (TileScripted) player.worldObj.getTileEntity(x, y, z);
|
||||
Client.sendData(EnumPacketServer.ScriptBlockDataGet, tileScripted.xCoord, tileScripted.yCoord, tileScripted.zCoord);
|
||||
BlockScriptPacket.Get(tileScripted.xCoord, tileScripted.yCoord, tileScripted.zCoord);
|
||||
}
|
||||
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
@@ -34,6 +35,6 @@ public class GuiScriptBlock extends GuiScriptInterface {
|
||||
|
||||
public void save() {
|
||||
super.save();
|
||||
Client.sendData(EnumPacketServer.ScriptBlockDataSave, tileScripted.xCoord, tileScripted.yCoord, tileScripted.zCoord, this.tileScripted.getNBT(new NBTTagCompound()));
|
||||
BlockScriptPacket.Save(tileScripted.xCoord, tileScripted.yCoord, tileScripted.zCoord, this.tileScripted.getNBT(new NBTTagCompound()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.google.common.reflect.ClassPath;
|
||||
import cpw.mods.fml.common.eventhandler.Event;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import cpw.mods.fml.common.network.FMLNetworkEvent;
|
||||
import kamkeel.npcs.network.packets.request.script.ForgeScriptPacket;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.event.entity.EntityEvent;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
@@ -12,8 +13,8 @@ import net.minecraftforge.event.world.ChunkEvent;
|
||||
import net.minecraftforge.event.world.ChunkWatchEvent;
|
||||
import net.minecraftforge.event.world.WorldEvent;
|
||||
import noppes.npcs.NBTTags;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
import noppes.npcs.controllers.ScriptContainer;
|
||||
import noppes.npcs.controllers.data.ForgeDataScript;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -62,7 +63,7 @@ public class GuiScriptForge extends GuiScriptInterface {
|
||||
hookList.add("onCNPCNaturalSpawn");
|
||||
|
||||
this.handler = this.script;
|
||||
Client.sendData(EnumPacketServer.ScriptForgeGet);
|
||||
ForgeScriptPacket.Get();
|
||||
}
|
||||
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
@@ -89,12 +90,12 @@ public class GuiScriptForge extends GuiScriptInterface {
|
||||
List<ScriptContainer> containers = this.script.getScripts();
|
||||
for (int i = 0; i < containers.size(); i++) {
|
||||
ScriptContainer container = containers.get(i);
|
||||
Client.sendData(EnumPacketServer.ScriptForgeSave, i, containers.size(), container.writeToNBT(new NBTTagCompound()));
|
||||
ForgeScriptPacket.Save(i, containers.size(), container.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
NBTTagCompound scriptData = new NBTTagCompound();
|
||||
scriptData.setString("ScriptLanguage", this.script.getLanguage());
|
||||
scriptData.setBoolean("ScriptEnabled", this.script.getEnabled());
|
||||
scriptData.setTag("ScriptConsole", NBTTags.NBTLongStringMap(this.script.getConsoleText()));
|
||||
Client.sendData(EnumPacketServer.ScriptForgeSave, -1, containers.size(), scriptData);
|
||||
ForgeScriptPacket.Save(-1, containers.size(), scriptData);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
package noppes.npcs.client.gui.script;
|
||||
|
||||
import kamkeel.npcs.network.packets.request.script.ScriptInfoPacket;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.gui.util.GuiNPCInterface;
|
||||
import noppes.npcs.client.gui.util.GuiNpcButton;
|
||||
import noppes.npcs.client.gui.util.IGuiData;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -35,7 +36,7 @@ public class GuiScriptGlobal extends GuiNPCInterface implements IGuiData {
|
||||
GuiNpcButton npcButton = new GuiNpcButton(2, this.guiLeft + 38, this.guiTop + 80, 100, 20, "All NPCs");
|
||||
npcButton.setEnabled(false);
|
||||
this.addButton(npcButton);
|
||||
Client.sendData(EnumPacketServer.ScriptGlobalGuiDataGet, new Object[0]);
|
||||
ScriptInfoPacket.Get();
|
||||
}
|
||||
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package noppes.npcs.client.gui.script;
|
||||
|
||||
import kamkeel.npcs.network.packets.request.script.ItemScriptPacket;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.CustomItems;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
import noppes.npcs.scripted.item.ScriptCustomItem;
|
||||
|
||||
public class GuiScriptItem extends GuiScriptInterface {
|
||||
@@ -25,7 +26,7 @@ public class GuiScriptItem extends GuiScriptInterface {
|
||||
hookList.add("finishItem");
|
||||
|
||||
this.handler = this.item = new ScriptCustomItem(new ItemStack(CustomItems.scripted_item));
|
||||
Client.sendData(EnumPacketServer.ScriptItemDataGet, new Object[0]);
|
||||
ItemScriptPacket.Get();
|
||||
}
|
||||
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
@@ -36,6 +37,6 @@ public class GuiScriptItem extends GuiScriptInterface {
|
||||
|
||||
public void save() {
|
||||
super.save();
|
||||
Client.sendData(EnumPacketServer.ScriptItemDataSave, new Object[]{this.item.getMCNbt()});
|
||||
ItemScriptPacket.Save(this.item.getMCNbt());
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
package noppes.npcs.client.gui.script;
|
||||
|
||||
import kamkeel.npcs.network.packets.request.script.PlayerScriptPacket;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import noppes.npcs.NBTTags;
|
||||
import noppes.npcs.client.Client;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
|
||||
import noppes.npcs.controllers.ScriptContainer;
|
||||
import noppes.npcs.controllers.data.PlayerDataScript;
|
||||
|
||||
@@ -75,7 +76,7 @@ public class GuiScriptPlayers extends GuiScriptInterface {
|
||||
hookList.add("partyDisband");
|
||||
|
||||
this.handler = this.script;
|
||||
Client.sendData(EnumPacketServer.ScriptPlayerGet);
|
||||
PlayerScriptPacket.Get();
|
||||
}
|
||||
|
||||
public void setGuiData(NBTTagCompound compound) {
|
||||
@@ -102,12 +103,12 @@ public class GuiScriptPlayers extends GuiScriptInterface {
|
||||
List<ScriptContainer> containers = this.script.getScripts();
|
||||
for (int i = 0; i < containers.size(); i++) {
|
||||
ScriptContainer container = containers.get(i);
|
||||
Client.sendData(EnumPacketServer.ScriptPlayerSave, i, containers.size(), container.writeToNBT(new NBTTagCompound()));
|
||||
PlayerScriptPacket.Save(i, containers.size(), container.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
NBTTagCompound scriptData = new NBTTagCompound();
|
||||
scriptData.setString("ScriptLanguage", this.script.getLanguage());
|
||||
scriptData.setBoolean("ScriptEnabled", this.script.getEnabled());
|
||||
scriptData.setTag("ScriptConsole", NBTTags.NBTLongStringMap(this.script.getConsoleText()));
|
||||
Client.sendData(EnumPacketServer.ScriptPlayerSave, -1, containers.size(), scriptData);
|
||||
PlayerScriptPacket.Save(-1, containers.size(), scriptData);
|
||||
}
|
||||
}
|
||||
@@ -10,10 +10,10 @@ import net.minecraft.client.gui.GuiYesNo;
|
||||
import net.minecraft.client.gui.GuiYesNoCallback;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.client.Client;
|
||||
|
||||
import noppes.npcs.client.NoppesUtil;
|
||||
import noppes.npcs.constants.EnumGuiType;
|
||||
import noppes.npcs.constants.EnumPacketServer;
|
||||
|
||||
import noppes.npcs.entity.EntityNPCInterface;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
package noppes.npcs.constants;
|
||||
|
||||
import noppes.npcs.CustomNpcsPermissions;
|
||||
|
||||
public enum EnumPacketServer {
|
||||
ScriptGlobalGuiDataSave(CustomNpcsPermissions.SCRIPT_GLOBAL, false),
|
||||
ScriptGlobalGuiDataGet(false),
|
||||
|
||||
ScriptPlayerSave(CustomNpcsPermissions.SCRIPT_PLAYER, false),
|
||||
ScriptPlayerGet(false),
|
||||
|
||||
ScriptForgeSave(CustomNpcsPermissions.SCRIPT_FORGE, false),
|
||||
ScriptForgeGet(false),
|
||||
|
||||
ScriptGlobalNPCSave(CustomNpcsPermissions.SCRIPT_GLOBAL, false),
|
||||
ScriptGlobalNPCGet(false),
|
||||
|
||||
ScriptItemDataSave(CustomNpcsPermissions.SCRIPT_ITEM, false),
|
||||
ScriptItemDataGet(false),
|
||||
|
||||
ScriptBlockDataSave(CustomNpcsPermissions.SCRIPT_BLOCK, false),
|
||||
ScriptBlockDataGet(false),
|
||||
|
||||
ScriptDataSave(CustomNpcsPermissions.SCRIPT_NPC, true),
|
||||
ScriptDataGet(true),
|
||||
|
||||
EventScriptDataSave(CustomNpcsPermissions.SCRIPT_NPC, true),
|
||||
EventScriptDataGet(true);
|
||||
|
||||
public CustomNpcsPermissions.Permission permission = null;
|
||||
public boolean needsNpc = false;
|
||||
|
||||
EnumPacketServer() {}
|
||||
|
||||
EnumPacketServer(CustomNpcsPermissions.Permission permission, boolean npc) {
|
||||
this(permission);
|
||||
}
|
||||
EnumPacketServer(boolean npc) {
|
||||
needsNpc = npc;
|
||||
}
|
||||
EnumPacketServer(CustomNpcsPermissions.Permission permission) {
|
||||
this.permission = permission;
|
||||
}
|
||||
public boolean hasPermission() {
|
||||
return permission != null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user