Résolu Crash serveur
-
Voila mon mod fonctionne en solo mais en serveur il crash
le crash report:
:::
–-- Minecraft Crash Report ----
// Why did you do that?Time: 18/08/16 23:50
Description: Exception in server tick loopcpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/renderer/entity/Render
at cpw.mods.fml.common.LoadController.transition(LoadController.java:162)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:692)
at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:97)
at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:319)
at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:213)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/renderer/entity/Render
at com.degraduck.minefus.Minefus.init(Minefus.java:52)
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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
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.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
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.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691)
… 5 more
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)
… 33 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 net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279)
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176)
… 35 moreA detailed walkthrough of the error, its code path and all known details is as follows:
– System Details –
Details:
Minecraft Version: 1.7.10
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_101, Oracle Corporation
Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 973033168 bytes (927 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
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.05 FML v7.10.85.1291 Minecraft Forge 10.13.2.1291 4 mods loaded, 4 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
FML{7.10.85.1291} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized
Forge{10.13.2.1291} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1291.jar) Unloaded->Constructed->Pre-initialized->Initialized
modminefus{1.0.0} [Mod Minefus] (bin) Unloaded->Constructed->Pre-initialized->Errored
Profiler Position: N/A (disabled)
Is Modded: Definitely; Server brand changed to ‘fml,forge’
Type: Dedicated Server (map_server.txt)
:::les classes:
package com.degraduck.minefus; import java.awt.Color; import com.degraduck.minefus.creativetabs.BlockMinefusCreativeTabs; import com.degraduck.minefus.creativetabs.lootMinefusCreativeTabs; import com.degraduck.minefus.entity.mobs.EntityBouftou; import com.degraduck.minefus.init.M_Block; import com.degraduck.minefus.init.M_BlockMulti; import com.degraduck.minefus.init.M_Loot; import com.degraduck.minefus.init.M_Mob; import com.degraduck.minefus.proxy.CommonProxy; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.registry.EntityRegistry; import net.minecraft.creativetab.CreativeTabs; @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION) public class Minefus { @Instance("modminefus") public static Minefus instance; @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS) public static CommonProxy proxy; public static CreativeTabs BlockMinefusCreativeTabs = new BlockMinefusCreativeTabs("blockminefus_creative_tabs"); public static CreativeTabs LootMinefusCreativeTabs = new lootMinefusCreativeTabs("lootminefus_creative_tabs"); @EventHandler public void preInit(FMLPreInitializationEvent event) { M_Block.init(); M_BlockMulti.init(); M_Loot.init(); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); M_Mob.init(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
package com.degraduck.minefus.entity.mobs; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.monster.EntityMob; import net.minecraft.world.World; public class EntityBouftou extends EntityMob { public EntityBouftou(World world) { super(world); } public void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(40D); this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(6D); this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(0.5D); this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.8D); } }
package com.degraduck.minefus.proxy; import com.degraduck.minefus.entity.mobs.EntityBouftou; import com.degraduck.minefus.init.M_Mob; import com.degraduck.minefus.models.mobs.ModelBouftou; import com.degraduck.minefus.render.mobs.RenderBouftou; import cpw.mods.fml.client.registry.RenderingRegistry; public class ClientProxy extends CommonProxy { @Override public void registerRender() { //System.out.println("méthode côté client"); M_Mob.register(); } }
package com.degraduck.minefus.init; import java.awt.Color; import com.degraduck.minefus.Minefus; import com.degraduck.minefus.entity.mobs.EntityBouftou; import com.degraduck.minefus.models.mobs.ModelBouftou; import com.degraduck.minefus.render.mobs.RenderBouftou; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.registry.EntityRegistry; public class M_Mob { public static void init() { EntityRegistry.registerGlobalEntityID(EntityBouftou.class, "bouftou", EntityRegistry.findGlobalUniqueEntityId(), new Color(0, 255, 0).getRGB(), new Color(255, 0, 0).getRGB()); EntityRegistry.registerModEntity(EntityBouftou.class, "bouftou", 420, Minefus.instance, 40, 1, true); } public static void register() { RenderingRegistry.registerEntityRenderingHandler(EntityBouftou.class, new RenderBouftou(new ModelBouftou(), 0.5F)); } }
-
Le rapport de crash ne correspond pas aux classes envoyés, renvoi le bon crash report avec les bonnes classes.
PS : pense à respecter la convention java
-
Le crash report est bon, je ne vois pas ou c’est marqué la classe en question.
J’essaie de la respecter, où ais-je fais une erreur de convention?
-
Le problème vient de là : M_Mob.init(); mais tu n’appelles pas la classe Render
-
@SCAREX le rapport correspond bien (juste qu’il a mis quelques classes inutiles dans ce cas), à une ligne près je pense.
Montre ton ServerProxy et ton CommonProxy, tu as une classe client appelée dans l’un d’eux.
Pour la convention, le “_” de M_Mob n’est pas bon. -
Salut,
Ajoutes un @SideOnly au dessus de la fonction register de ta classe M_Mob -
Quand je met le @SideOnly j’ai une erreur: “The annotation @SideOnly must define the attribute value”
-
@SideOnly(Side.CLIENT) et met le bien au dessus de la fonction register
-
Merci beaucoup. Résolu!