brandon3055 Posted May 8, 2014 Author Posted May 8, 2014 Ok so i essentially deleted and re-downloaded EVERYTHING event deleted the .gradle/caches/minecraft folder so it would re download all the minecraft files and Updated to forge 1070. Unfortunately it didnt fix anything although now when i load the game i get the following error for all my blocks and items... [10:33:47] [server thread/WARN] [FML]: **************************************** [10:33:47] [server thread/WARN] [FML]: * Illegal extra prefix tolkienaddon for name tolkienaddon:testBlock, invalid registry invocation/invalid name? [10:33:47] [server thread/WARN] [FML]: * at cpw.mods.fml.common.registry.GameData.registerItem(GameData.java:733) [10:33:47] [server thread/WARN] [FML]: * at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:211) [10:33:47] [server thread/WARN] [FML]: * at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:167) [10:33:47] [server thread/WARN] [FML]: * at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:156) [10:33:47] [server thread/WARN] [FML]: * at tolkienaddon.blocks.ModBlocks.register(ModBlocks.java:27) [10:33:47] [server thread/WARN] [FML]: * at tolkienaddon.blocks.TestBlock.<init>(TestBlock.java:23)... [10:33:47] [server thread/WARN] [FML]: **************************************** [10:33:47] [server thread/WARN] [FML]: **************************************** [10:33:47] [server thread/WARN] [FML]: * Illegal extra prefix tolkienaddon for name tolkienaddon:sunFocus, invalid registry invocation/invalid name? [10:33:47] [server thread/WARN] [FML]: * at cpw.mods.fml.common.registry.GameData.registerItem(GameData.java:733) [10:33:47] [server thread/WARN] [FML]: * at cpw.mods.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:139) [10:33:47] [server thread/WARN] [FML]: * at cpw.mods.fml.common.registry.GameRegistry.registerItem(GameRegistry.java:127) [10:33:47] [server thread/WARN] [FML]: * at tolkienaddon.items.ModItems.register(ModItems.java:86) [10:33:47] [server thread/WARN] [FML]: * at tolkienaddon.items.SunFocus.<init>(SunFocus.java:10) [10:33:47] [server thread/WARN] [FML]: * at tolkienaddon.items.ModItems.init(ModItems.java:61)... [10:33:47] [server thread/WARN] [FML]: **************************************** But everything still works so i have no idea what thats all about or how to fix it... I think for now i will just wait to see if you have the same problem. Edit: The error seems to be forge related i downgraded back to 1061 and it fixed it. I think it may be a bug because i cant see anything about it in the change log unless im looking in the wrong place? (changelog on the forge downloads page) Quote I am the author of Draconic Evolution
jabelar Posted May 8, 2014 Posted May 8, 2014 Note I responded on your other thread. I was able to update to 1071 without such errors although I have only a few items to register as my mod is mostly containing entities. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
brandon3055 Posted May 8, 2014 Author Posted May 8, 2014 yea i will look into that later the packet handling is my biggest concern right now Quote I am the author of Draconic Evolution
jabelar Posted May 8, 2014 Posted May 8, 2014 I worked on it a bit last night. I had to catch up with where you're at, so worked on implementing the client to server stuff. i got that working pretty handily. I didn't quite get to the multiplayer testing because I the other computers on my network were all in use, but I think I can try again tonight (although it is my anniversary so will be going out for dinner and ). Sorry for the delay. I promise to keep looking at this though as my time permits. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
brandon3055 Posted May 8, 2014 Author Posted May 8, 2014 No problem. You dont need multiple computers to test multiplayer!!! simply start both the client and the server i your eclipse workspace (at the same time) and connect to the server using ":25565" (the server port) Im not sure if you were actually planning to run 1 instance in server mode or two clients (with one open to lan) but just in case you dont know how to run your project in multiplayer mode you need to do the following. 1. create a new run configuration called "server" (or whatever you want) 2. set the main class to cpw.mods.fml.relauncher.ServerLaunchWrapper 3. leave Program arguments blank and in VM arguments add -Xincgc -Xmx1024M -Xms1024M and thats it hit run and and the server should start and you should get the server gui instead of the regular minecraft window. Edit: Just tested lan multiplayer works just fine probably because the server also has a client so its essentially the same as singleplayer just with an extra client. Quote I am the author of Draconic Evolution
jabelar Posted May 8, 2014 Posted May 8, 2014 No problem. You dont need multiple computers to test multiplayer!!! simply start both the client and the server i your eclipse workspace (at the same time) and connect to the server using ":25565" (the server port) Im not sure if you were actually planning to run 1 instance in server mode or two clients (with one open to lan) but just in case you dont know how to run your project in multiplayer mode you need to do the following. 1. create a new run configuration called "server" (or whatever you want) 2. set the main class to cpw.mods.fml.relauncher.ServerLaunchWrapper 3. leave Program arguments blank and in VM arguments add -Xincgc -Xmx1024M -Xms1024M and thats it hit run and and the server should start and you should get the server gui instead of the regular minecraft window. Thanks, yeah I normally test multiplayer with separate computers. I can try it both ways, and yes I do have a Server run configuration set up in Eclipse. I'm slightly leery that running on the same computer could cause some issues with networking though especially when debugging custom packets. I have multiple gaming computers in the house so will try it that way too. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
jabelar Posted May 8, 2014 Posted May 8, 2014 Okay, I haven't got to the multiplayer yet because I noticed a weird thing with the client to server packets. While it seems pretty clear in my code that it is only sending one packet from client to server, the onServerPacket event seems to fire twice -- the first time with the expected packet (i.e payload is as expected) and second time with an apparently 0 payload (at least that is what the first int read gives. I'm pretty certain that the event is only happening on the server side because I assume the event is only there, then I check the side in the event handler method and check the side again later in the process packet method. So there is some sort of spurious packet event. I can ignore it, but would like to understand it. Reading through the FMLNetworkEvent class there is some mention of a "reply" packet, but I'm not sure if that is related (especially since I think it would go the other way). Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
brandon3055 Posted May 9, 2014 Author Posted May 9, 2014 I noticed the same thing. I think the server packet handler is being registered on both the server and the client so when sending a packet from the client it is received both on the server and the client that sent it. But i may be wrong. Quote I am the author of Draconic Evolution
jabelar Posted May 9, 2014 Posted May 9, 2014 I noticed the same thing. I think the server packet handler is being registered on both the server and the client so when sending a packet from the client it is received both on the server and the client that sent it. But i may be wrong. That was my first thought but I don't think that is the case because the side field in both events indicated server side. You know, maybe you should go back and use a different packet handling scheme. My initial success with the server to client packets was so easy that I thought the rest would be straight forward. But looks like some debug is needed. I'm gong to work on it but probably not as fast as you need. I won't take it personally if you abandon my approach. The frustrating thing is it seems so close to working... Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
brandon3055 Posted May 9, 2014 Author Posted May 9, 2014 The frustrating thing is it seems so close to working... Tell me about it thats why I have been messing with it for so long it is just so close to working I will finish the project i am working on then i will look into the other options but i will be keeping an eye on this and may switch back if you get it working because this is just so simple to use. BTW i assume from your posts that it dosnt but you haven't actually confirmed weather or not it works for you in multiplayer. Quote I am the author of Draconic Evolution
jabelar Posted May 9, 2014 Posted May 9, 2014 BTW i assume from your posts that it dosnt but you haven't actually confirmed weather or not it works for you in multiplayer. Sorry no, still working on it. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
SanAndreaP Posted May 9, 2014 Posted May 9, 2014 If you wanna try a different approach on packet handling, look at this code: https://github.com/SanAndreasP/SAPManagerPack/tree/master/java/de/sanandrew/core/manpack/mod/packet https://github.com/SanAndreasP/SAPManagerPack/blob/master/java/de/sanandrew/core/manpack/mod/ModCntManPack.java And simultaneously this tutorial I've based it off (I recode some stuff, since it was a bit messy IMO) http://www.minecraftforge.net/wiki/Netty_Packet_Handling Quote Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
jabelar Posted May 9, 2014 Posted May 9, 2014 If you wanna try a different approach on packet handling, look at this code: https://github.com/SanAndreasP/SAPManagerPack/tree/master/java/de/sanandrew/core/manpack/mod/packet https://github.com/SanAndreasP/SAPManagerPack/blob/master/java/de/sanandrew/core/manpack/mod/ModCntManPack.java And simultaneously this tutorial I've based it off (I recode some stuff, since it was a bit messy IMO) http://www.minecraftforge.net/wiki/Netty_Packet_Handling I like this one. It also seems pretty straight forward and actually takes a similar approach to what I was trying to do. Since you're a much more expert coder than I, I assume that this already works in multiplayer as well? Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
brandon3055 Posted May 9, 2014 Author Posted May 9, 2014 If you wanna try a different approach on packet handling, look at this code: https://github.com/SanAndreasP/SAPManagerPack/tree/master/java/de/sanandrew/core/manpack/mod/packet https://github.com/SanAndreasP/SAPManagerPack/blob/master/java/de/sanandrew/core/manpack/mod/ModCntManPack.java And simultaneously this tutorial I've based it off (I recode some stuff, since it was a bit messy IMO) http://www.minecraftforge.net/wiki/Netty_Packet_Handling I was going to check out your earlier suggestion is this the same? Anyway i wont be starting on that until i finish what i am current project which is mostly just cleaning up my mod... may take a while lol. Quote I am the author of Draconic Evolution
brandon3055 Posted May 9, 2014 Author Posted May 9, 2014 @SanAndreasP Im trying to figure out how to use your system but im a bit lost can you please show me an example of how to send and receive a packet? Also i noticed you have a method in your proxy called "registerPackets" im not exactly sure how that works ether. I apologize for being such a noob Edit: also you have channelHandler = new ChannelHandler(ModCntManPack.MOD_ID, ModCntManPack.MOD_CHANNEL); in a modConstruction(FMLConstructionEvent event) method i assume this is something to do with your mod being a core mod in my case would i just add new ChannelHandler(MOD_ID, MOD_CHANNEL); to public static ChannelHandler channelHandler;? Edit2: I think im starting to figure it out but one thing i dont understand is "sendToAll(IPacket message)" Edit3: I think I have it figured out. Edit4: IT WORKS!!! although i discovered something interesting. The onBlockActivated method is only called client side when playing multiplayer Edit5: onBlockActivated dosnt run server side if the block is within the protected spawn area and the player activating it is not op! Edit6: that's a lot of edits... well at least i didn't hex post. Quote I am the author of Draconic Evolution
SanAndreaP Posted May 10, 2014 Posted May 10, 2014 If you wanna try a different approach on packet handling, look at this code: https://github.com/SanAndreasP/SAPManagerPack/tree/master/java/de/sanandrew/core/manpack/mod/packet https://github.com/SanAndreasP/SAPManagerPack/blob/master/java/de/sanandrew/core/manpack/mod/ModCntManPack.java And simultaneously this tutorial I've based it off (I recode some stuff, since it was a bit messy IMO) http://www.minecraftforge.net/wiki/Netty_Packet_Handling I like this one. It also seems pretty straight forward and actually takes a similar approach to what I was trying to do. Since you're a much more expert coder than I, I assume that this already works in multiplayer as well? Yes, works flawless for me. @SanAndreasP Im trying to figure out how to use your system but im a bit lost can you please show me an example of how to send and receive a packet? Also i noticed you have a method in your proxy called "registerPackets" im not exactly sure how that works ether. I apologize for being such a noob Edit: also you have channelHandler = new ChannelHandler(ModCntManPack.MOD_ID, ModCntManPack.MOD_CHANNEL); in a modConstruction(FMLConstructionEvent event) method i assume this is something to do with your mod being a core mod in my case would i just add new ChannelHandler(MOD_ID, MOD_CHANNEL); to public static ChannelHandler channelHandler;? Edit2: I think im starting to figure it out but one thing i dont understand is "sendToAll(IPacket message)" Edit3: I think I have it figured out. Edit4: IT WORKS!!! although i discovered something interesting. The onBlockActivated method is only called client side when playing multiplayer Edit5: onBlockActivated dosnt run server side if the block is within the protected spawn area and the player activating it is not op! Edit6: that's a lot of edits... well at least i didn't hex post. There's an example packet class in the link. To send / receive packets, use something like this: IPacket packet = new PacketChangeBCGUI(3, this.teBiomeChanger.xCoord, this.teBiomeChanger.yCoord, this.teBiomeChanger.zCoord); ESPModRegistry.channelHandler.sendToServer(packet); First instantiate the new Packet class with the parameters you wanna send, then just send it with your channelHandler. 1. I had some problems when I initialized directly on declaration, so you might wanna use the preInit for that. You can also use the modConstruction event like I did, it's fired also for normal mods. 5. I think this is a problem with MC directly, idk. Quote Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
brandon3055 Posted May 10, 2014 Author Posted May 10, 2014 I am sending packets like this. Tolkienaddon.channelHandler.sendToServer(new ButtonPacket((button.id, true)); ant it seems to be working perfectly what difference would it make if i use IPacket packet = new ButtonPacket((button.id, true); ESPModRegistry.channelHandler.sendToServer(packet); Quote I am the author of Draconic Evolution
jabelar Posted May 10, 2014 Posted May 10, 2014 It looks like you're making progress with SanAndreas' method. In terms of my method, I have set up multiplayer in the dev environment and it fails with what I think is same error you saw: [13:59:45] [server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception java.lang.NoClassDefFoundError: net/minecraft/client/multiplayer/WorldClient at wildanimals.entities.herdanimals.EntityHerdAnimal.sendSyncPacket(EntityHerdAnimal.java:474) ~[EntityHerdAnimal.class:?] at wildanimals.entities.herdanimals.EntityHerdAnimal.setRearing(EntityHerdAnimal.java:417) ~[EntityHerdAnimal.class:?] at wildanimals.entities.herdanimals.EntityHerdAnimal.attackEntityFrom(EntityHerdAnimal.java:292) ~[EntityHerdAnimal.class:?] at net.minecraft.entity.player.EntityPlayer.attackTargetEntityWithCurrentItem(EntityPlayer.java:1401) ~[EntityPlayer.class:?] at net.minecraft.network.NetHandlerPlayServer.processUseEntity(NetHandlerPlayServer.java:873) ~[NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:51) ~[C02PacketUseEntity.class:?] at net.minecraft.network.play.client.C02PacketUseEntity.processPacket(C02PacketUseEntity.java:69) ~[C02PacketUseEntity.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:232) ~[NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:720) ~[MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:341) ~[DedicatedServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:608) ~[MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:746) [MinecraftServer$2.class:?] Caused by: java.lang.ClassNotFoundException: net.minecraft.client.multiplayer.WorldClient at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:188) ~[launchwrapper-1.9.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_51] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_51] ... 14 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/multiplayer/WorldClient for invalid side SERVER at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50) ~[forgeSrc-1.7.2-10.12.1.1071.jar:?] at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:276) ~[launchwrapper-1.9.jar:?] at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:174) ~[launchwrapper-1.9.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[?:1.7.0_51] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[?:1.7.0_51] The weird thing is that, as far as I can understand, it seems to be a problem with the vanilla class WorldClient. I'm not sure that we could have really mucked that up. Seems like some bug. I'll start a separate topic on that issue itself -- how could it fail to find the vanilla class? Otherwise, it is possible it is issue with running multiplayer in development environment on same computer. I think I'll try to see if I can get it running with exported mods on separate computers. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
brandon3055 Posted May 11, 2014 Author Posted May 11, 2014 Yup thats the same error i got and i already tried exporting the mod but i didn't try separate computers although i don't think it would make much difference. Quote I am the author of Draconic Evolution
SanAndreaP Posted May 11, 2014 Posted May 11, 2014 I am sending packets like this. Tolkienaddon.channelHandler.sendToServer(new ButtonPacket((button.id, true)); ant it seems to be working perfectly what difference would it make if i use IPacket packet = new ButtonPacket((button.id, true); ESPModRegistry.channelHandler.sendToServer(packet); I just like to seperate stuff. It's just a difference in coding style, not a functional one. BTW: the registerPackets method in my proxies are deprecated. I didn't come around to remove them, so you can ignore those. Quote Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
jabelar Posted May 12, 2014 Posted May 12, 2014 By the way, since the thread started with question about my packet handling system, the solution was there was some missing @SideOnly annotation in the Packet class. In any case, both methods are very similar. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
Recommended Posts
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.