
FLUFFY2
Forge Modder-
Posts
424 -
Joined
-
Last visited
Everything posted by FLUFFY2
-
So, good news and bad news. Good is it works on dedicated servers. I opened a server and 2 clients with 2 different login details. It worked. Bad news is, if i open 2 client and open a LAN the crash happends. So dedicated server works, LAN crashes. Mayebe its something up with that i cant debug 2 clients with LAN?
-
Okay, it start to piss me off! I made a new project called "dummymod", just because of that. And it still crashes, it dosent matter where is the packet sent from(block or item action), it dosent matter where IMessage and IMessageHandler is implemenet in 1 class. It always gonna crash, yet a made a full clean installation of the latest forge, updated java, deleted .gradle. So yeah, the bug is in Forge for sure now.
-
Yeah, mayebe. I gonna update forge, do a clean workspace install and make a dummy mod just for that.
-
Okay, i tried "ambnet", no luck. I make a new packet that is empty, it has the default constructor and no info inside. It still crash. I think that .sendToAll() is the problem, because in my previous 1.8 modding i got this kind of crashes as well, when i used sendToAll, but i replaced it with the entity tracked packet sending and it fixed all, yet i didnt know this bug. Just to prove even more, i got another mod, wich works perfectly it also has a sendToAll method and it also crashes. All the other packets .sendTo and .sendToServer works without crash. And they are made the same way like the problematic ones. So i think .sendToAll is broken
-
On the main class: public static SimpleNetworkWrapper snw; .... @EventHandler public void preInit(FMLPreInitializationEvent event){ //Pakets snw = NetworkRegistry.INSTANCE.newSimpleChannel(AmnesiaMusicBox.ModID); snw.registerMessage(MusicBoxMessageHandler.class, MusicBoxMessage.class, 0, Side.CLIENT); snw.registerMessage(LoadFilesMessageHandler.class, LoadFilesMessageHandler.class, 1, Side.CLIENT); snw.registerMessage(MusicBoxGuiMessageHandler.class, MusicBoxGuiMessageHandler.class, 2, Side.SERVER); } The mod id is: AmnesiaMusicBox wich isnt more than 20 character.
-
Okay, i did a few system prints. The data is correct, on toByte and fromByte. I also noticed that the crash happends randomly. If i send the packet i got a 90% chance of crashing. Sometimes it goes througth right. I also checked out that i remove all the fields, and send an empty packet. The toByte and fromByte can be empty, and the onMessage can be empty also, but i got a crash like this. FMLIndexedMessageCodec exception caught io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.15.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(Unknown Source) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(Unknown Source) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(Unknown Source) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(Unknown Source) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(Unknown Source) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(Unknown Source) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:132) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_60] Caused by: java.lang.IndexOutOfBoundsException at io.netty.buffer.EmptyByteBuf.readByte(EmptyByteBuf.java:440) ~[EmptyByteBuf.class:4.0.15.Final] at net.minecraft.network.PacketBuffer.readByte(Unknown Source) ~[PacketBuffer.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(Unknown Source) ~[FMLIndexedMessageToMessageCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(Unknown Source) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.15.Final] ... 39 more
-
Hi, I got a little problem, where i get a crash on the client side when i send a packet form the server to all clients. If the server is a LAN server than the "client" where the server is opened it dont crash only for other clients. Register in preInit(ID 0 isnt duplicated): snw.registerMessage(MusicBoxMessageHandler.class, MusicBoxMessage.class, 0, Side.CLIENT); Packet: public class MusicBoxMessage implements IMessage { int x, y, z; int track; int volume; boolean repeat; boolean isAmb; public MusicBoxMessage(){ } public MusicBoxMessage(BlockPos pos, int track, int volume, boolean repeat, boolean isAmb){ this.x = pos.getX(); this.y = pos.getY(); this.z = pos.getZ(); this.track = track; this.volume = volume; this.repeat = repeat; this.isAmb = isAmb; } @Override public void toBytes(ByteBuf buf){ buf.writeInt(x); buf.writeInt(y); buf.writeInt(z); buf.writeInt(track); buf.writeInt(volume); buf.writeBoolean(repeat); buf.writeBoolean(isAmb); } @Override public void fromBytes(ByteBuf buf){ this.x = buf.readInt(); this.y = buf.readInt(); this.z = buf.readInt(); this.track = buf.readInt(); this.volume = buf.readInt(); this.repeat = buf.readBoolean(); this.isAmb = buf.readBoolean(); } } Pakcet handler: public class MusicBoxMessageHandler implements IMessageHandler<MusicBoxMessage, IMessage> { public MusicBoxMessageHandler(){ } @Override public IMessage onMessage(final MusicBoxMessage message, final MessageContext ctx) { IThreadListener threadlistener = Minecraft.getMinecraft(); threadlistener.addScheduledTask(new Runnable(){ public void run(){ BlockPos pos = new BlockPos(message.x, message.y, message.z); AmnesiaMusicBox.proxy.playMusic(pos, message.track, message.volume, message.repeat, message.isAmb); } }); return null; } } Sending the packet: @Override public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock){ if(!worldIn.isRemote){ TileEntityMusicBox custombox = ((TileEntityMusicBox)worldIn.getTileEntity(pos)); if(worldIn.isBlockIndirectlyGettingPowered(pos) > 0 && !(Boolean)state.getValue(POWERED)){ worldIn.setBlockState(pos, state.withProperty(POWERED, true)); AmnesiaMusicBox.snw.sendToAll(new MusicBoxMessage(pos, custombox.track, custombox.volume, custombox.repeat, custombox.isAmb)); } else if(worldIn.isBlockIndirectlyGettingPowered(pos) == 0 && (Boolean)state.getValue(POWERED)){ worldIn.setBlockState(pos, state.withProperty(POWERED, false)); } } } Crash: FMLIndexedMessageCodec exception caught io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(21) + length(1) exceeds writerIndex(21): SlicedByteBuf(ridx: 21, widx: 21, cap: 21/21, unwrapped: UnpooledHeapByteBuf(ridx: 1, widx: 22, cap: 22)) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.15.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(Unknown Source) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(Unknown Source) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(Unknown Source) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(Unknown Source) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(Unknown Source) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(Unknown Source) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:132) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_60] Caused by: java.lang.IndexOutOfBoundsException: readerIndex(21) + length(1) exceeds writerIndex(21): SlicedByteBuf(ridx: 21, widx: 21, cap: 21/21, unwrapped: UnpooledHeapByteBuf(ridx: 1, widx: 22, cap: 22)) at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1161) ~[AbstractByteBuf.class:4.0.15.Final] at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:563) ~[AbstractByteBuf.class:4.0.15.Final] at io.netty.buffer.AbstractByteBuf.readBoolean(AbstractByteBuf.java:572) ~[AbstractByteBuf.class:4.0.15.Final] at com.fluffy2.amnesiamusicbox.pakets.MusicBoxMessage.fromBytes(MusicBoxMessage.java:47) ~[MusicBoxMessage.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(Unknown Source) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.simpleimpl.SimpleIndexedCodec.decodeInto(Unknown Source) ~[simpleIndexedCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(Unknown Source) ~[FMLIndexedMessageToMessageCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(Unknown Source) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.15.Final] ... 39 more It pointing to this line: this.isAmb = buf.readBoolean(); I dont know what the hell is the problem with that, i checked the order of writing and reading, i checked and the data is both correct on client and server. I dont know simply what it wants. Thanks for helping!
-
Hi, I got my layer renderer up and its working except the fact that the vanilla layers registered inside the RenderPlayer are having higer priority..... it owerrides the change i want to made. So what i want to do is when a player is holding an item i want to modify the right arm, but since LayerHeldItem override all my code, i need to remove it. So what you think will the following work? 1.Check if player holding specific item 2.In RenderPlayerEvent add the custom layer if the item is in the hand, but also remove the vanilla one, with reflection. 3.If the player deequip the item, readd the vanilla layer. So this way it has compability. I would also create a boolean to not add the layer every frame. Im open to any sugesstions! Thanks!
-
I might rethink the whole thing, i dont know, im too lazy! Thank you anyways diesieben, you rock!
-
Forgot to say: Im not letting client to change other client data. I just make so my client actually reads the other clients correct data.
-
Yeah, thats true, but i need to carry the data over. What i do is: On the client i check if a player has an item in a specific inventory slot, and set the Extended Player data. I send that data to the server, set the Exteded Player data there as well, and send the data to all other tracking players. I need to carry the ID, for the client. You might ask then: WTF? Why not just check the inventory on the server, set the Extended Player on the server, and send to all tracking player(and to myself). Answer is simple! In the PlayerTickEvent, event.player means all player on the server. it lists all player. So it causes confusion in the packet, and the data changes wierdly, sometimes even not. That means, i need to use Minecraft.getMinecraft().thePlayer to get myself. Since i cant send packet from client to client, i need to do client to server to clients. So yeah, i didn't find any easier method.
-
I didn't get you. Than whats the purpose of the responce in the packets? .registerMessage(TestMessageHandler.class, TestMessageHandler.class, 3, Side.CLIENT); .registerMessage(TestMessageHandler.class, TestMessageHandler.class, 4, Side.SERVER); .sendToServer(new TestMessageHandler(data)); public IMessage onMessage(final HotbarLanternMessageHandler message, final MessageContext ctx){ if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT){ }else{ } }
-
Ahahahah, indeed, it fixed the problem! IThreadListener threadlistener = Minecraft.getMinecraft(); threadlistener.addScheduledTask(new Runnable(){ public void run(){ //Message to run } }); So, i need to ask you, do i have to implement thread safety to all the packets, or its not recommended. How can i see, if a packet needs thread safety? The network thread cant access some game object, now what are these objects? Thanks diesieben!
-
I'm checking the side, because the packet is send to the server to set values and the packet itself send it back to the client. Its like a response packet, you need side checking, because if a server packet send a response back to the client it will also tries to run the server code and evenutally crash. I'm just not using the return feature, instead i send the packet diferently. I need side checking, but that part dont has to do anything with the current porblem. But if you dont belive me you can always set up a packet, register it on both side, and make it send to the server that return a responce to the client. You will see you need side checking. I read the "Warning" thing now, let see if it fixes it. Thanks!
-
Hi guys, I have a problem with the tracking event, where i send a packet to the client and when getting the other player from its ID inside the packet, it returns null for some reason. I guess the tracking starts before the client gets to know the other client. Here is how i send the packet: @SubscribeEvent public void StartTracking(PlayerEvent.StartTracking event){ if(event.target instanceof EntityPlayer){ EntityPlayer target = (EntityPlayer)event.target; if(!event.entityPlayer.worldObj.isRemote){ ExtendedPlayerPropertiesHandler props = ExtendedPlayerPropertiesHandler.get(target); AmnesiaLights.snw.sendTo(new HotbarLanternMessageHandler(target, props.hotbarLantern), (EntityPlayerMP)event.entityPlayer); } } } Here is my packet: package com.fluffy2.amnesialights.pakets; import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.WorldServer; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.network.simpleimpl.IMessage; import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.relauncher.Side; import com.fluffy2.amnesialights.AmnesiaLights; import com.fluffy2.amnesialights.handler.ExtendedPlayerPropertiesHandler; public class HotbarLanternMessageHandler implements IMessage, IMessageHandler<HotbarLanternMessageHandler, IMessage> { private int hotbarLantern; private int playerID; public HotbarLanternMessageHandler(){ } public HotbarLanternMessageHandler(EntityPlayer player, int hotbarLantern){ this.hotbarLantern = hotbarLantern; this.playerID = player.getEntityId(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(hotbarLantern); buf.writeInt(playerID); } @Override public void fromBytes(ByteBuf buf) { this.hotbarLantern = buf.readInt(); this.playerID = buf.readInt(); } @Override public IMessage onMessage(final HotbarLanternMessageHandler message, final MessageContext ctx){ if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT){ EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().theWorld.getEntityByID(message.playerID); ExtendedPlayerPropertiesHandler.get(player).hotbarLantern = message.hotbarLantern; }else{ EntityPlayer player = ctx.getServerHandler().playerEntity; ExtendedPlayerPropertiesHandler.get(player).hotbarLantern = message.hotbarLantern; ((WorldServer)player.worldObj).getEntityTracker().sendToAllTrackingEntity(player, AmnesiaLights.snw.getPacketFrom(new HotbarLanternMessageHandler(player, message.hotbarLantern))); } return null; } } So the problem in the packet is this line: EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().theWorld.getEntityByID(message.playerID); It returns null! So my guess is, when the player connects to the server, the tracing starts, and the server sync the clients, but the packet is sent before the sync and the client cant find the other player by its entity ID. Thanks for helping!
-
OMG WHAT THE FUUUUUU*K???!!!! snw.registerMessage(SettingsMessageHandler.class, SettingsMessageHandler.class, 1, Side.CLIENT); This was the whole problem. I set up a config system, where the joining player gets the server config, and when leaves it changes back to original. Since i set the packet to recieve on SERVER side instead of CLIENT all the configs get null. And the actual value needed to do the visible rendering was null. So the system worked, but the another value was null. Yeah i hate when myself. Anyways thany for the help guys. The "Client to Clients" sync works now!
-
Okay, here we go. Main class: http://pastebin.com/82VEuvp6 PlayerEvent.StartTracking: http://pastebin.com/v9Z0081W The Extended Player Properties: http://pastebin.com/fpTqb4i1 The packet: http://pastebin.com/UriYbsu4
-
Okay, i managed to get some things working, but sometimes i got a crash. I done the Tracking and closest player part. So it not cause all players to get the packet. FMLIndexedMessageCodec exception caught io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(0) + length(1) exceeds writerIndex(9): UnpooledHeapByteBuf(ridx: 0, widx: 9, cap: 256) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.15.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(Unknown Source) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(Unknown Source) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(Unknown Source) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(Unknown Source) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(Unknown Source) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(Unknown Source) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:312) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:44) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel$6.run(LocalChannel.java:298) [LocalChannel$6.class:4.0.15.Final] at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_60] Caused by: java.lang.IndexOutOfBoundsException: readerIndex(0) + length(1) exceeds writerIndex(9): UnpooledHeapByteBuf(ridx: 0, widx: 9, cap: 256) at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1161) ~[AbstractByteBuf.class:4.0.15.Final] at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:563) ~[AbstractByteBuf.class:4.0.15.Final] at net.minecraft.network.PacketBuffer.readByte(Unknown Source) ~[PacketBuffer.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(Unknown Source) ~[FMLIndexedMessageToMessageCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(Unknown Source) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.15.Final] ... 24 more [18:08:22] [Netty Local Client IO #1/ERROR]: SimpleChannelHandlerWrapper exception io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(0) + length(1) exceeds writerIndex(9): UnpooledHeapByteBuf(ridx: 0, widx: 9, cap: 256) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.15.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(Unknown Source) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(Unknown Source) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(Unknown Source) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(Unknown Source) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(Unknown Source) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(Unknown Source) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.finishPeerRead(LocalChannel.java:312) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel.access$400(LocalChannel.java:44) [LocalChannel.class:4.0.15.Final] at io.netty.channel.local.LocalChannel$6.run(LocalChannel.java:298) [LocalChannel$6.class:4.0.15.Final] at io.netty.channel.local.LocalEventLoop.run(LocalEventLoop.java:33) [LocalEventLoop.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_60] Caused by: java.lang.IndexOutOfBoundsException: readerIndex(0) + length(1) exceeds writerIndex(9): UnpooledHeapByteBuf(ridx: 0, widx: 9, cap: 256) at io.netty.buffer.AbstractByteBuf.checkReadableBytes(AbstractByteBuf.java:1161) ~[AbstractByteBuf.class:4.0.15.Final] at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:563) ~[AbstractByteBuf.class:4.0.15.Final] at net.minecraft.network.PacketBuffer.readByte(Unknown Source) ~[PacketBuffer.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(Unknown Source) ~[FMLIndexedMessageToMessageCodec.class:?] at net.minecraftforge.fml.common.network.FMLIndexedMessageToMessageCodec.decode(Unknown Source) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:4.0.15.Final] ... 24 more Im pretty sure i registered my pakets and its IDs correctly. Also sometimes i can see this when sending a packet, not always, just sometimes appears: [Netty Server IO #0/ERROR]: java.lang.IndexOutOfBoundsException: readerIndex: 10 (expected: 0 <= readerIndex <= writerIndex(9)) It appears like 3-5 times than crash happends.
-
1. What the hell is that??? Never heard of it..... oh.... 1.8 and its great features, i see now. 2.I just used it for temp testing, but if that could be the problem than okay, i change it fast. Thanks!
-
Wait... i got new resoults, but wierd ones. 1st client finally get to know the 2nd client data, the resould is the 1st can see the rendering. But when the 1st client toggled the data, the 2nd client didn't see anything. Hows that??? The 1st client(the LAN host) can see the other player and his rendering. The 2nd client cant see the other and his rendering, but the 1st client gets the updated info. I play more around that in a bit.
-
Okay, i changed so it only sends the data. I registered with this, in the main class inside preInit(): public static SimpleNetworkWrapper snw; ......... snw = NetworkRegistry.INSTANCE.newSimpleChannel(AmnesiaLights.ModID); snw.registerMessage(HotbarLanternMessageHandler.class, HotbarLanternMessageHandler.class, 3, Side.CLIENT); I checked it and the ID 3 isn't duplicated! The full packet is this: public class HotbarLanternMessageHandler implements IMessage, IMessageHandler<HotbarLanternMessageHandler, IMessage> { private int hotbarLantern; private int playerID; public HotbarLanternMessageHandler(){ } public HotbarLanternMessageHandler(EntityPlayer player, int hotbarLantern){ this.hotbarLantern = hotbarLantern; this.playerID = player.getEntityId(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(hotbarLantern); buf.writeInt(playerID); } @Override public void fromBytes(ByteBuf buf) { this.hotbarLantern = buf.readInt(); this.playerID = buf.readInt(); } @Override public IMessage onMessage(HotbarLanternMessageHandler message, MessageContext ctx){ EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().theWorld.getEntityByID(message.playerID); ExtendedPlayerPropertiesHandler.get(player).setHotbarLantern(message.hotbarLantern); return null; } } Thanks for helping!
-
Thank you guys for the help! So i used entityID and think throught the logic 100 times now, yet its not working. I got a crash on the other clients side. Here is what i have done so far: On a PlayerTick event i have this: if(!world.isRemote){ if(player.inventory.mainInventory[8] != null && player.inventory.mainInventory[8].getItem() == AmnesiaLights.LanternOn){ if(props.hotbarLantern() != 1) //NOTE: I do this to not constantly send pakets props.setHotbarLantern(1); }else if(player.inventory.mainInventory[8] != null && player.inventory.mainInventory[8].getItem() == AmnesiaLights.LanternOff){ if(props.hotbarLantern() != 2) props.setHotbarLantern(2); }else{ if(props.hotbarLantern() != 0) props.setHotbarLantern(0); } } On the ExtendedPlayerProps i have this: public void setHotbarLantern(int state){ this.hotbarLantern = state; AmnesiaLights.snw.sendToAll(new HotbarLanternMessageHandler(player)); //Yes ALL for now, i will use the player tracking later diesieben. } And the actual packet, what yields the crash: private NBTTagCompound data; private int playerID; public HotbarLanternMessageHandler(){ } public HotbarLanternMessageHandler(EntityPlayer player){ data = new NBTTagCompound(); playerID = player.getEntityId(); ExtendedPlayerPropertiesHandler.get(player).saveNBTData(data); } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeTag(buf, data); buf.writeInt(playerID); } @Override public void fromBytes(ByteBuf buf) { this.data = ByteBufUtils.readTag(buf); this.playerID = buf.readInt(); } @Override public IMessage onMessage(HotbarLanternMessageHandler message, MessageContext ctx){ EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().theWorld.getEntityByID(message.playerID); ExtendedPlayerPropertiesHandler.get(player).loadNBTData(message.data); return null; } And the crash: [Netty Client IO #5/ERROR]: FMLIndexedMessageCodec exception caught io.netty.handler.codec.DecoderException: java.lang.NullPointerException: Undefined message for discriminator 10 in channel AmnesiaLights at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) [EmbeddedChannel.class:4.0.15.Final] at net.minecraftforge.fml.common.network.internal.FMLProxyPacket.processPacket(Unknown Source) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.channelRead0(Unknown Source) [NetworkManager.class:?] at net.minecraft.network.NetworkManager.channelRead0(Unknown Source) [NetworkManager.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.handleClientSideCustomPacket(Unknown Source) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(Unknown Source) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.channelRead0(Unknown Source) [NetworkDispatcher.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:103) [simpleChannelInboundHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:153) [byteToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [MessageToMessageDecoder.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.handler.timeout.ReadTimeoutHandler.channelRead(ReadTimeoutHandler.java:149) [ReadTimeoutHandler.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:338) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:324) [DefaultChannelHandlerContext.class:4.0.15.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) [DefaultChannelPipeline.class:4.0.15.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:132) [AbstractNioByteChannel$NioByteUnsafe.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:485) [NioEventLoop.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:452) [NioEventLoop.class:4.0.15.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:346) [NioEventLoop.class:4.0.15.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101) [singleThreadEventExecutor$2.class:4.0.15.Final] at java.lang.Thread.run(Unknown Source) [?:1.8.0_60] Something is null, but i dont really get what. I tried null checks it still crashes. Thanks for helping!
-
Hi there, Basically i have a data saved into the player with ExtendedPlayerProperties. That data is synced between the ACTUAL client and server. This data is used for rendering. For my client i can see the rendering, but for other clients they can see sh*t. Thats because i need to send the data from the server to their clients to update the info. I know how pakets work i have a working SNW and everything. The problem is how can i make others clients to readn my client data? DataWatcher works and makes render the model for other clients, but i dont want to use that, because of the limited IDs. Here is what im doing now: I grab the data form the server and send to all clients. But what? How can i make other clients to set my client data with the correct value??? They cant access my player, because there is only 2 way to access players in pakets. .getServerHandler().playerEntity or Minecraft.getMinecraft(). Nothing like .getTheSenderPlayer(). Thanks for helping!
-
I would advise EntityConstruct event to add the your layer to the RenderPlayer instance. Use Minecraft.getMinecraft().getRenderManager.getEntityRenderObject(EntityPlayerSP); Make sure you use the client player, and check if the entity is instance of the EntityPlayer.
-
Okay, apparently you cant have soild and translucent part in the same model. I changed the texture and use CUTOUT_MIPPED, thats the only thing that works. Normal CUTOUT also cause the problem.