mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-14 01:24:09 +00:00
SideOnly Client for Client Packets
This commit is contained in:
1 parent
1c97d84518
commit
e8e868993b
46 files changed
+90
-134
No files matched your search
@@ -2,6 +2,7 @@ package kamkeel.npcs.network.packets.client;
|
||||
|
||||
import cpw.mods.fml.common.ObfuscationReflectionHelper;
|
||||
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;
|
||||
@@ -53,14 +54,12 @@ public final class AchievementPacket extends AbstractPacket {
|
||||
ByteBufUtils.writeString(out, this.message);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(!ConfigClient.BannerAlerts)
|
||||
return;
|
||||
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
boolean isNotParty = !in.readBoolean();
|
||||
String description = StatCollector.translateToLocal(ByteBufUtils.readString(in));
|
||||
String message = ByteBufUtils.readString(in);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -41,14 +42,12 @@ public final class ChatAlertPacket extends AbstractPacket {
|
||||
ByteBufUtils.fillBuffer(out, this.objects);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(!ConfigClient.ChatAlerts)
|
||||
return;
|
||||
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
StringBuilder message = new StringBuilder();
|
||||
String str;
|
||||
while ((str = Server.readString(in)) != null && !str.isEmpty()) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -50,11 +51,9 @@ public final class ChatBubblePacket extends AbstractPacket {
|
||||
out.writeBoolean(this.hideText);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(in.readInt());
|
||||
if(!(entity instanceof EntityNPCInterface))
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -36,11 +37,9 @@ public final class ConfigCommandPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
int configType = in.readInt();
|
||||
if (configType == 0) { // Font Configuration
|
||||
String font = Server.readString(in);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -51,11 +52,9 @@ public final class DialogPacket extends AbstractPacket {
|
||||
ByteBufUtils.writeNBT(out, this.compound);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
int entityID = in.readInt();
|
||||
String name = ByteBufUtils.readString(in);
|
||||
NBTTagCompound tagCompound = ByteBufUtils.readNBT(in);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -33,11 +34,9 @@ public final class DisableMouseInputPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
long duration = in.readLong();
|
||||
String parsedButtons = Server.readString(in);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -36,11 +37,9 @@ public final class MarkDataPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
Entity entity = player.worldObj.getEntityByID(in.readInt());
|
||||
if (!(entity instanceof EntityNPCInterface)) return;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -36,11 +37,9 @@ public final class OverlayQuestTrackingPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
try {
|
||||
NBTTagCompound nbt = Server.readNBT(in);
|
||||
ClientCacheHandler.questTrackingOverlay = new OverlayQuestTracking(Minecraft.getMinecraft());
|
||||
|
||||
@@ -65,11 +65,9 @@ public final class ParticlePacket extends AbstractPacket {
|
||||
ByteBufUtils.writeString(out, particle);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
spawnParticle(in);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -38,11 +39,9 @@ public final class PartyDataPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if (gui instanceof GuiNPCInterface && ((GuiNPCInterface) gui).hasSubGui()) {
|
||||
gui = (GuiScreen) ((GuiNPCInterface) gui).getSubGui();
|
||||
|
||||
+2
-3
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -35,11 +36,9 @@ public final class PlayerUpdateSkinOverlaysPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
String playerName = Server.readString(in);
|
||||
NBTTagCompound nbt = Server.readNBT(in);
|
||||
EntityPlayer sendingPlayer = Minecraft.getMinecraft().theWorld.getPlayerEntityByName(playerName);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -33,11 +34,9 @@ public final class QuestCompletionPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
NoppesUtil.guiQuestCompletion(player, Server.readNBT(in));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -44,11 +45,9 @@ public final class RolePacket extends AbstractPacket {
|
||||
ByteBufUtils.writeNBT(out, this.compound);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
NBTTagCompound compound = ByteBufUtils.readNBT(in);
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(compound.getInteger("EntityId"));
|
||||
if (entity instanceof EntityNPCInterface) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -32,11 +33,9 @@ public final class ScriptOverlayClosePacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
int overlayId = in.readInt();
|
||||
ClientCacheHandler.customOverlays.remove(overlayId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -35,11 +36,9 @@ public final class ScriptOverlayDataPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
OverlayCustom overlayCustom = new OverlayCustom(Minecraft.getMinecraft());
|
||||
overlayCustom.setOverlayData(Server.readNBT(in));
|
||||
ClientCacheHandler.customOverlays.put(overlayCustom.overlay.getID(), overlayCustom);
|
||||
|
||||
@@ -46,6 +46,7 @@ public final class ScriptedParticlePacket extends AbstractPacket {
|
||||
ByteBufUtils.writeNBT(out, compound);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -35,11 +36,9 @@ public final class ScrollSelectedPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if (gui instanceof IScrollData) {
|
||||
String selected = Server.readString(in);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -32,11 +33,9 @@ public final class StopSoundForPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
int soundId = in.readInt();
|
||||
ScriptSoundController.Instance.stopSound(soundId);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -32,11 +33,9 @@ public final class StopSoundsPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
ScriptSoundController.Instance.stopAllSounds();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -32,11 +33,9 @@ public final class SwingPlayerArmPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
Minecraft.getMinecraft().thePlayer.swingItem();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -39,11 +40,9 @@ public final class UpdateAnimationsPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
NBTTagCompound nbt = Server.readNBT(in);
|
||||
AnimationData animationData = null;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client;
|
||||
|
||||
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;
|
||||
@@ -34,11 +35,9 @@ public final class VillagerListPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
MerchantRecipeList recipes = MerchantRecipeList.func_151390_b(new PacketBuffer(in));
|
||||
ServerEventsHandler.Merchant.setRecipes(recipes);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.gui;
|
||||
|
||||
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;
|
||||
@@ -41,10 +42,9 @@ public final class GuiClonerPacket extends AbstractPacket {
|
||||
ByteBufUtils.writeNBT(out, compound);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
NBTTagCompound nbt = ByteBufUtils.readNBT(in);
|
||||
NoppesUtil.openGUI(player, new GuiNpcMobSpawnerAdd(nbt));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.gui;
|
||||
|
||||
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;
|
||||
@@ -46,11 +47,9 @@ public final class GuiClosePacket extends AbstractPacket {
|
||||
ByteBufUtils.writeNBT(out, compound);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if (gui instanceof IGuiClose) {
|
||||
int closeCode = in.readInt();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.gui;
|
||||
|
||||
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;
|
||||
@@ -45,11 +46,9 @@ public final class GuiDataPacket extends AbstractPacket {
|
||||
ByteBufUtils.writeNBT(out, compound);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if (gui instanceof GuiNPCInterface && ((GuiNPCInterface) gui).hasSubGui()) {
|
||||
gui = (GuiScreen) ((GuiNPCInterface) gui).getSubGui();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.gui;
|
||||
|
||||
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;
|
||||
@@ -46,11 +47,9 @@ public final class GuiErrorPacket extends AbstractPacket {
|
||||
ByteBufUtils.writeNBT(out, compound);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
GuiScreen gui = Minecraft.getMinecraft().currentScreen;
|
||||
if (gui instanceof IGuiError) {
|
||||
int errorCode = in.readInt();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.gui;
|
||||
|
||||
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;
|
||||
@@ -47,11 +48,9 @@ public final class GuiOpenPacket extends AbstractPacket {
|
||||
out.writeInt(z);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
EnumGuiType gui = EnumGuiType.values()[in.readInt()];
|
||||
int x = in.readInt();
|
||||
int y = in.readInt();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.gui;
|
||||
|
||||
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;
|
||||
@@ -34,11 +35,9 @@ public final class GuiRedstonePacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
NBTTagCompound nbt = Server.readNBT(in);
|
||||
NoppesUtil.saveRedstoneBlock(player, nbt);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.gui;
|
||||
|
||||
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;
|
||||
@@ -31,11 +32,9 @@ public final class GuiTeleporterPacket extends AbstractPacket {
|
||||
@Override
|
||||
public void sendData(ByteBuf out) throws IOException {}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
CustomNpcs.proxy.openGui((EntityNPCInterface)null, EnumGuiType.NpcDimensions);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.gui;
|
||||
|
||||
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;
|
||||
@@ -34,11 +35,9 @@ public final class GuiWaypointPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
NBTTagCompound nbt = Server.readNBT(in);
|
||||
NoppesUtil.saveWayPointBlock(player, nbt);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.gui;
|
||||
|
||||
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;
|
||||
@@ -33,11 +34,9 @@ public final class IsGuiOpenPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
boolean isGuiOpen = Minecraft.getMinecraft().currentScreen != null;
|
||||
NoppesUtil.isGUIOpen(isGuiOpen);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.gui;
|
||||
|
||||
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;
|
||||
@@ -36,11 +37,9 @@ public final class OpenBookPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
int x = in.readInt();
|
||||
int y = in.readInt();
|
||||
int z = in.readInt();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.npc;
|
||||
|
||||
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;
|
||||
@@ -40,11 +41,9 @@ public final class DeleteNpcPacket extends AbstractPacket {
|
||||
out.writeInt(this.entityId);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(in.readInt());
|
||||
if (entity instanceof EntityNPCInterface) {
|
||||
((EntityNPCInterface) entity).delete();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.npc;
|
||||
|
||||
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;
|
||||
@@ -40,11 +41,9 @@ public final class EditNpcPacket extends AbstractPacket {
|
||||
out.writeInt(this.entityId);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(in.readInt());
|
||||
if (!(entity instanceof EntityNPCInterface)) {
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.npc;
|
||||
|
||||
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;
|
||||
@@ -36,11 +37,9 @@ public final class UpdateNpcPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
NBTTagCompound compound = Server.readNBT(in);
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(compound.getInteger("EntityId"));
|
||||
if (entity instanceof EntityNPCInterface) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.sound;
|
||||
|
||||
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;
|
||||
@@ -32,11 +33,9 @@ public final class ContinueSoundsPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
ScriptSoundController.Instance.continueAllSounds();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.sound;
|
||||
|
||||
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;
|
||||
@@ -32,11 +33,9 @@ public final class PauseSoundsPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
ScriptSoundController.Instance.pauseAllSounds();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.sound;
|
||||
|
||||
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;
|
||||
@@ -33,11 +34,9 @@ public final class PlayMusicPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
String musicName = Server.readString(in);
|
||||
MusicController.Instance.playMusicBackground(musicName, player, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.sound;
|
||||
|
||||
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;
|
||||
@@ -33,11 +34,9 @@ public final class PlaySoundPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
String soundName = Server.readString(in);
|
||||
float x = in.readFloat();
|
||||
float y = in.readFloat();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.sound;
|
||||
|
||||
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;
|
||||
@@ -35,11 +36,9 @@ public final class PlaySoundToNoIdPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
NBTTagCompound nbt = Server.readNBT(in);
|
||||
ScriptClientSound sound = ScriptClientSound.fromScriptSound(nbt, player.worldObj);
|
||||
ScriptSoundController.Instance.playSound(sound);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.sound;
|
||||
|
||||
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;
|
||||
@@ -35,11 +36,9 @@ public final class PlaySoundToPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
int soundId = in.readInt();
|
||||
NBTTagCompound nbt = Server.readNBT(in);
|
||||
ScriptClientSound sound = ScriptClientSound.fromScriptSound(nbt, player.worldObj);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.sync;
|
||||
|
||||
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;
|
||||
@@ -34,11 +35,9 @@ public final class SyncConfigPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
NBTTagCompound configNBT = Server.readNBT(in);
|
||||
SyncController.receiveConfigs(configNBT);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.sync;
|
||||
|
||||
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;
|
||||
@@ -35,11 +36,9 @@ public final class SyncRecipesAddPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
NBTTagList list = Server.readNBT(in).getTagList("recipes", 10);
|
||||
if (list != null) {
|
||||
for (int i = 0; i < list.tagCount(); i++) {
|
||||
|
||||
+2
-3
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.sync;
|
||||
|
||||
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;
|
||||
@@ -32,11 +33,9 @@ public final class SyncRecipesCarpentryBenchPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
RecipeController.Instance.anvilRecipes = RecipeController.syncRecipes;
|
||||
RecipeController.syncRecipes.clear();
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.sync;
|
||||
|
||||
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;
|
||||
@@ -32,11 +33,9 @@ public final class SyncRecipesWorkbenchPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
RecipeController.reloadGlobalRecipes(RecipeController.syncRecipes);
|
||||
RecipeController.syncRecipes.clear();
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kamkeel.npcs.network.packets.client.sync;
|
||||
|
||||
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;
|
||||
@@ -36,11 +37,9 @@ public final class SyncWeaponPacket extends AbstractPacket {
|
||||
// TODO: Send Packet
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
|
||||
if(CustomNpcs.side() != Side.CLIENT)
|
||||
return;
|
||||
|
||||
Entity entity = player.worldObj.getEntityByID(in.readInt());
|
||||
if (!(entity instanceof EntityNPCInterface)) return;
|
||||
|
||||
|
||||
Reference in new issue
Block a user