Jump to content

deadrecon98

Forge Modder
  • Posts

    316
  • Joined

Everything posted by deadrecon98

  1. I am getting output from my console but the issue that I had shown above is fixed. I was calling sync() inside of the wrong function. As for the rest it should work fine but for some reason it doesn't. Note: The crafting is flawless but for some reason the client is still not getting ANY data from the server. I have updated the GitHub again so that you can see all of the changes i've made.
  2. Check Original Post. ^^ (I just uploaded it to github for times sake.)
  3. Oh.. I'd rather not get into that. This is confusing me enough as it is.
  4. I've done what you said but not a single thing has changed. Same error, slightly modified code.
  5. I was using that a first but I am updating the data very often so it seems packets are necesary.
  6. Ok I will get to work on that tomorrow. As for using int[] I was trying to make a completely flexible packet but I'm not sure that's possible. Or at least worth trying.
  7. It seems for some reason that my packet isn't being sent to the client whenever I try to use my sync() method. I use this whenever I copy over the data from a player death and whenever the player joins. Here is the code.
  8. I was planning on that but peeps keep replying. It might be best if you did lock it. ;P
  9. I'm saying that if I couldn't handle being proved wrong I wouldn't be here. All you have done is prove me wrong. Not that I mean it in a bad way, that is the only way to show me what I am doing wrong. I just don't like it when you take up an attitude with me. You're not the only one here agitated.
  10. If I had a problem with you saying that i'm wrong I would have left long before we hit page 3.
  11. This is bullshit. In 1.5.2 you created a Packet250CustomPayload manually by whatever means and then send that manually. To client or server. Then you had ONE packet handler for both which received all your packets. Most people then sent a packetID as the first byte in the packet data and had humongous switch statements on that packetID containing all their packet handling code in ONE method. Now you have one IMessage + IMessageHandler for each of those packetIDs. Each packet has a defined direction (from client to server or the other way around). The IMessage encapsulates the data you want to send. The IMessageHandler then does something with that data. I'm here to get help on something that I am not very proficient at. I do not need you to sit here and insult me. If you are going to be rude then please butt out. I am glad that you have helped me thus far but I will not tolerate being treated this way. I am doing everything that I can to understand what you are saying. I wouldn't say that's cause to be rude, would you?
  12. I do understand what packets are but like I have said before. You barely explained what was what in your tutorial. In 1.5.2 you needed to send it through a manager for the server and then grab it again for the client in another manager. I am completely confused as to what you are trying to explain here.
  13. Your joking? I followed YOUR tutorial and it said that you needed both a Server-side packet and a Client-side packet. So what is it, do I need one or not?
  14. Send your render code so that I can help you with the texture issues.
  15. Just make a render for the armor and then make it not render the armor when the player is invisible.
  16. Ok, I see where you were talking about thePlayer issue and fixed that. Would I also need to put the new packet code into the ServerPacketManager as well?
  17. Okay, you still haven't explained to me how I can send multiple data types in one packet. As for it crashing on a dedicated server, how in the friggin world am I supposed to fix that?
  18. Here is how to use IExtendedProperties or whatever. You will need to figure out how to make it work with IInventory.
  19. Maybe try a tick handler? That seems to tick once every 100th of a second. (or 1 milisecond)
  20. I've fixed everything now but here you go. package com.Cyphereion.RunesOfAltura.Manager; import net.minecraft.client.Minecraft; import com.Cyphereion.RunesOfAltura.RunesOfAltura; import com.Cyphereion.RunesOfAltura.Data.EntityPlayerExtended; import io.netty.buffer.ByteBuf; import cpw.mods.fml.common.network.ByteBufUtils; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; public class ClientPacketManager implements IMessage { private String text; private static LogManager log = RunesOfAltura.instance.log; public ClientPacketManager() { } public ClientPacketManager(String text) { this.text = text; } @Override public void fromBytes(ByteBuf buf) { text = ByteBufUtils.readUTF8String(buf); } @Override public void toBytes(ByteBuf buf) { ByteBufUtils.writeUTF8String(buf, text); } public static class Handler implements IMessageHandler<ClientPacketManager, IMessage> { @Override public IMessage onMessage(ClientPacketManager message, MessageContext ctx){ String[] args = message.text.split(":"); EntityPlayerExtended player = EntityPlayerExtended.get(Minecraft.getMinecraft().thePlayer); player.magicXP = Integer.parseInt(args[0]); player.magicLevel = Integer.parseInt(args[1]); log.debug(String.format("Received %s from " + Minecraft.getMinecraft().thePlayer.getDisplayName(), message.text)); return null; } } }
  21. Wow, that took AGES. Thank you for being so patient with me, it tends to take a crap-ton of explaining but I will get it eventually!
  22. I don't understand... i'm not accessing it from the client. I have went out of my way to set up two completely different packet handlers, one for the server, one for the client. What am I doing wrong? If you are talking about where I did this: RunesOfAltura.network.sendTo(new ServerPacketManager(this.magicXP + ":" + this.magicLevel), (EntityPlayerMP)player); then I have no idea what's wrong there, I changed it to ClientPacketManager and it didn't change a thing. EDIT: I went through EVERY piece of code I have, and finally found what you were talking about. I changed ctx.getServerHandler().playerEntity.getDisplayName() to ctx.getClientHandler() but now I cannot get the player for the client. How would I get it so that I can update the data for it?
  23. I see what your talking about but how would I fix that? Like I said, packets are not what they used to be.
  24. I still don't understand what your getting at. Forget that the packet is a String, that shouldn't hurt anything. How could I fix the issue with the client not able receive it properly? This is error it gives me, I don't understand what is happening here. java.lang.ClassCastException: net.minecraft.client.network.NetHandlerPlayClient cannot be cast to net.minecraft.network.NetHandlerPlayServer at cpw.mods.fml.common.network.simpleimpl.MessageContext.getServerHandler(MessageContext.java:36) ~[MessageContext.class:?] at com.Cyphereion.RunesOfAltura.Manager.ClientPacketManager$Handler.onMessage(ClientPacketManager.java:33) ~[ClientPacketManager$Handler.class:?] at com.Cyphereion.RunesOfAltura.Manager.ClientPacketManager$Handler.onMessage(ClientPacketManager.java:1) ~[ClientPacketManager$Handler.class:?] at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:37) ~[simpleChannelHandlerWrapper.class:?] at cpw.mods.fml.common.network.simpleimpl.SimpleChannelHandlerWrapper.channelRead0(SimpleChannelHandlerWrapper.java:17) ~[simpleChannelHandlerWrapper.class:?] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:98) ~[simpleChannelInboundHandler.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[MessageToMessageDecoder.class:?] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?] at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:86) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) [NetworkManager.class:?] at net.minecraft.client.multiplayer.PlayerControllerMP.updateController(PlayerControllerMP.java:317) [PlayerControllerMP.class:?] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1682) [Minecraft.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1028) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:951) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:78) [start/:?] at GradleStart.main(GradleStart.java:45) [start/:?]
  25. Well like I said, I am still confused as to how this new packet system works. Used to I would create one packet and then send the data but with this it looks like I would have to create two packets. I really don't know much of what's going on here. I've looked at your tutorial but you didn't really go far into depth on it.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.