Fix Packets not working for testing

This commit is contained in:
Kam committed 2025-01-30 18:44:50 -05:00
1 parent e77a1032d3
commit 9ea1385ac2
4 files changed
+22 -7

No files matched your search

@@ -37,12 +37,6 @@ public final class ClonerPacket extends LargeAbstractPacket {
return PacketHandler.DATA_PACKET;
}
@SideOnly(Side.CLIENT)
@Override
public void receiveData(ByteBuf in, EntityPlayer player) throws IOException {
NBTTagCompound nbt = ByteBufUtils.readNBT(in);
NoppesUtil.openGUI(player, new GuiNpcMobSpawnerAdd(nbt));
}
@Override
protected byte[] getData() throws IOException {
@@ -10,6 +10,7 @@ import kamkeel.npcs.network.enums.EnumDataPacket;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import noppes.npcs.CustomNpcs;
import noppes.npcs.client.NoppesUtil;
import noppes.npcs.constants.EnumGuiType;
import java.io.IOException;
@@ -61,6 +62,6 @@ public final class GuiOpenPacket extends AbstractPacket {
int x = in.readInt();
int y = in.readInt();
int z = in.readInt();
CustomNpcs.proxy.openGui(null, gui, x, y, z);
CustomNpcs.proxy.openGui(NoppesUtil.getLastNpc(), gui, x, y, z);
}
}
@@ -83,6 +83,7 @@ public class ClientProxy extends CommonProxy {
public void load() {
Font = new FontContainer(ConfigClient.FontType, ConfigClient.FontSize);
createFolders();
CustomNpcs.Channel.register(new PacketHandlerClient());
CustomNpcs.ChannelPlayer.register(new PacketHandlerPlayer());
new MusicController();
new ScriptSoundController();
@@ -0,0 +1,19 @@
package noppes.npcs.client;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.FMLNetworkEvent;
import io.netty.buffer.ByteBuf;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import noppes.npcs.PacketHandlerServer;
import java.io.IOException;
public class PacketHandlerClient extends PacketHandlerServer {
@SubscribeEvent
public void onPacketData(FMLNetworkEvent.ClientCustomPacketEvent event) {
// Need this here for testing and registry for now until
// conversion is done
}
}