Posted March 5, 201411 yr i'm having a problem with the new netty system where i can send a packet in singleplayer without any problems but when i try on a local server (using ip: localhost) it seams that the client sends and encode the packet but it never run the decode or handleServerSide code's the packet i'm trying to send package com.dark2222.vampiremod.core.PacketHandler.packets; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; import com.dark2222.vampiremod.core.VampireMain; import com.dark2222.vampiremod.core.BloodCore.BloodCore; import com.dark2222.vampiremod.core.BloodCore.TickHandler; import com.dark2222.vampiremod.core.PacketHandler.AbstractPacket; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.network.ByteBufUtils; public class FoodPack extends AbstractPacket{ int i; public FoodPack() {} public FoodPack(int i){ this.i = i; } @Override public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { buffer.writeInt(i); } @Override public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { i = buffer.readInt(); } @Override public void handleClientSide(EntityPlayer player) { System.out.print("Running Client "); BloodCore props = BloodCore.get(player); } @Override public void handleServerSide(EntityPlayer player) { System.out.print("Running server "); BloodCore props = BloodCore.get(player); } } my packetpipeline class is just "copy-paste" from the tutorial as is the abstractPacket class i register the packages in the packetpipeline
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.