Résolu Crash côté serveur entity
-
Bonjour,
J’ai créer une entité en suivant un tuto, en solo elle fonctionne bien mais quand je le met sur le serveur, celle-ci fais crash. Je trouves pas d’où viens le problème…---- Mohist Crash Report ---- Time: 28/06/20 15:05 Description: Erreur dans la boucle de tick du serveur net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from DrunlyMod (drunly) Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/renderer/entity/Render at fr.hybridetv.drunly.init.RenderHandler.registerEntityRenders(RenderHandler.java:15) at fr.hybridetv.drunly.Drunly.preInit(Drunly.java:64) 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 net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:632) 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.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:215) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:193) 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.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:132) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:632) at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:102) at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:329) at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:167) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:591) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: net.minecraft.client.renderer.entity.Render at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 38 more Caused by: java.lang.NullPointerException at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ... 40 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Mohist version: 1.12.2-1.12.2-2541029 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_241, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 366240320 bytes (349 MB) / 881328128 bytes (840 MB) up to 3817865216 bytes (3641 MB) JVM Flags: 2 total; -Xms512M -Xmx4096M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 CraftBukkit Information: Running: Failed to handle CraftCrashReport: craftbukkit not runs FML: MCP 9.42 Powered by Forge 14.23.5.2854 6 mods loaded, 6 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored | State | ID | Version | Source | Signature | |:----- |:--------- |:-------------- |:-------------- |:--------- | | LCH | minecraft | 1.12.2 | minecraft.jar | None | | LCH | mcp | 9.42 | minecraft.jar | None | | LCH | mohist | 1.12.2-2541029 | mohist.jar | None | | LCH | FML | 8.0.99.99 | server.jar | None | | LCH | forge | 14.23.5.2854 | server.jar | None | | LCE | drunly | 1.0 | drunly-1.0.jar | None | Loaded coremods (and transformers): Profiler Position: N/A (disabled) Is Modded: Definitely; Server brand changed to 'Mohist' Type: Dedicated Server (map_server.txt)
package fr.hybridetv.drunly.init; import fr.hybridetv.drunly.tortue.EntityTurtle; import fr.hybridetv.drunly.tortue.RenderTurtle; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraftforge.fml.client.registry.IRenderFactory; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class RenderHandler { public static void registerEntityRenders() { RenderingRegistry.registerEntityRenderingHandler(EntityTurtle.class, new IRenderFactory<EntityTurtle>() { @Override public Render<? super EntityTurtle> createRenderFor(RenderManager manager) { return new RenderTurtle(manager); } }); } public static void registerCustomMeshesAndStates() { } }
package fr.hybridetv.drunly; import java.io.File; import fr.hybridetv.drunly.init.BiomeInit; import fr.hybridetv.drunly.init.BlocksMod; import fr.hybridetv.drunly.init.EntityInit; import fr.hybridetv.drunly.init.GuiHandler; import fr.hybridetv.drunly.init.ItemMod; import fr.hybridetv.drunly.init.ModRecipes; import fr.hybridetv.drunly.init.RenderHandler; import fr.hybridetv.drunly.init.TileEntityHandler; import fr.hybridetv.drunly.init.drunlytab; import fr.hybridetv.drunly.proxy.ServerProxy; import fr.hybridetv.drunly.utils.drunlyfarm; import fr.hybridetv.drunly.utils.drunlymachinery; import fr.hybridetv.drunly.world.WorldGenOres; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraftforge.event.RegistryEvent; import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.IWorldGenerator; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.registry.GameRegistry; @Mod(modid = References.MODID, name = References.NAME, version = References.VERSION, acceptedMinecraftVersions = References.MINECRAFT_VERSION) public class Drunly { @Instance(References.MODID) public static Drunly instance; public static File config; public static int loops = 1; @SidedProxy(clientSide = References.CLIENT_PROXY, serverSide = References.SERVER_PROXY, modId = References.MODID) public static ServerProxy proxy; public static final CreativeTabs drunlytab = new drunlytab("drunlytab"); public static final CreativeTabs drunlymachinery = new drunlymachinery("drunlymachinery"); public static final CreativeTabs drunlyfarm = new drunlyfarm("drunlyfarm"); @EventHandler public void preInit(FMLPreInitializationEvent event) { BlocksMod.init(); ItemMod.init(); EntityInit.registerEntities(); GameRegistry.registerWorldGenerator(new WorldGenOres(), 3); ModConfiguration.registerConfig(event); BiomeInit.registerBiomes(); TileEntityHandler.registerTileEntities(); GuiHandler.init(); RenderHandler.registerEntityRenders(); RenderHandler.registerCustomMeshesAndStates(); NetworkRegistry.INSTANCE.registerGuiHandler(Drunly.instance, new GuiHandler()); } @EventHandler public void init(FMLInitializationEvent event) { proxy.register(); ModRecipes.init(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
Si quelqu’un aurai la solution… ^Merci.
-
La fonction registerRender n’est probablement pas appelé depuis la classe principale, d’où le problème.
-
Bonjour,
Ton appel à la fonctionregisterEntityRenders
ne doit pas être fait depuis la classe principale mais depuis le proxy client afin qu’elle ne soit que appelé sur le client. -
Hmmm ok. J’ai modifié ça, ça crash plus mais maintenant mon entité n’as plus de texture ni de forme elle est blanche… Même en solo…
-
Donc c’est que ta fonction n’est plus du tout appelé.
Envoie le code de ton proxy client ? -
public class ClientProxy extends ServerProxy { public ClientProxy() { MinecraftForge.EVENT_BUS.register(this); } public void register() { Display.setTitle("Drunly V1.0" + " - " +Minecraft.getMinecraft().getSession().getUsername()); } @Override public void registerRender() { RenderHandler.registerEntityRenders(); }
Voilà
-
La fonction registerRender n’est probablement pas appelé depuis la classe principale, d’où le problème.
-
Ok c’est bon ! J’ai du aussi retirer le
@Override
^^
Merci !