Aggurai Posted June 9, 2013 Posted June 9, 2013 Hello I am new to forge modding but am starting to get the hang of things. I have created a throw able entity, but it rendered as a white cube, so I added a RenderingRegistry.registerEntityRenderingHandler(BaseEntity.class, new RenderSnowball(ThrowCraft.baseEgg)) To my client proxy in a void that overrides the server/common proxy. However, this did nothing. Then I moved that line into the initialization event in my main mod class, and it worked! but, now it does not work in SMP as the server crashes because it tries to load the renderers for the server too. Obviously this is what the ClientProxy is for, but mine doesn't seem to be working if it worked in my main init event and not in there. In my main mod class I have the @SideProxy set up @SidedProxy(clientSide="aggurai.throwcraft.client.TCClientProxy", serverSide="aggurai.throwcraft.common.TCCommonProxy") public static TCCommonProxy proxy; And the Common/Server proxy package aggurai.throwcraft.common; public class TCCommonProxy { public void registerRenderThings() { // TODO Auto-generated method stub //lol } } And the client proxy that I tried rendering the entity in, and want to be able to render it in package aggurai.throwcraft.client; import net.minecraft.client.renderer.entity.RenderSnowball; import aggurai.throwcraft.ThrowCraft; import aggurai.throwcraft.common.TCCommonProxy; import aggurai.throwcraft.entity.BaseEntity; import cpw.mods.fml.client.registry.RenderingRegistry; public class TCClientProxy extends TCCommonProxy { @Override public void registerRenderThings() { RenderingRegistry.registerEntityRenderingHandler(BaseEntity.class, new RenderSnowball(ThrowCraft.baseEgg)); } } If you could help that would be amazing! I know its probably a really simple mistake, if you need any more info let me know and I will give it to you. Quote
SanAndreaP Posted June 9, 2013 Posted June 9, 2013 Can we see the crash log? 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.
Aggurai Posted June 9, 2013 Author Posted June 9, 2013 Here is the crash of the server, only if I have the render code in Init: ---- Minecraft Crash Report ---- // Don't be sad, have a hug! <3 Time: 09/06/13 12:17 Description: Exception in server tick loop java.lang.NoClassDefFoundError: net/minecraft/client/renderer/entity/Render at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:425) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98) at cpw.mods.fml.common.Loader.loadMods(Loader.java:503) at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:85) at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:350) at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:69) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:430) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) Caused by: java.lang.ClassNotFoundException: net.minecraft.client.renderer.entity.Render at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:238) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 29 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/entity/Render for invalid side SERVER at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50) at cpw.mods.fml.relauncher.RelaunchClassLoader.runTransformers(RelaunchClassLoader.java:352) at cpw.mods.fml.relauncher.RelaunchClassLoader.findClass(RelaunchClassLoader.java:225) ... 31 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.5.2 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_21, Oracle Corporation Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 994845904 bytes (948 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v7.51 FML v5.2.2.684 Minecraft Forge 7.8.0.684 4 mods loaded, 4 mods active mcp{7.44} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed FML{5.2.2.684} [Forge Mod Loader] (coremods) Unloaded->Constructed Forge{7.8.0.684} [Minecraft Forge] (coremods) Unloaded->Constructed ThrowCraft{0.7.0} [ThrowCraft Reloaded] (bin) Unloaded Profiler Position: N/A (disabled) Is Modded: Definitely; Server brand changed to 'fml,forge' Type: Dedicated Server (map_server.txt) But it shouldn't have to be in init, I need it to work in my ClientProxy so i don't get the server error from the server trying to access the renderers Quote
Aggurai Posted June 9, 2013 Author Posted June 9, 2013 I should also add, I just tried adding the render code to one of my @SideOnly(Side.CLIENT) voids inside the actual item class, and that works on SMP too, however I really need to get the client proxy working instead of doing it this way Quote
TheGrovesyProject101 Posted June 9, 2013 Posted June 9, 2013 can i see the whole main class if possible please Quote My youtube channel for forge tutorials: http://www.youtube.com/user/TheGrovesyProject101?feature=mhee if i helped please press thank you
Draco18s Posted June 10, 2013 Posted June 10, 2013 You need a EntityRegistry.registerModEntity call. Example: EntityRegistry.registerModEntity(EntityMyEnt.class, "MyEntity", 1, this, 350, 5, false); Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
ObsequiousNewt Posted June 10, 2013 Posted June 10, 2013 Make sure you're actually calling the proxy init; I derped that way myself. Quote BEWARE OF GOD --- Co-author of Pentachoron Labs' SBFP Tech.
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.