Résolu [CRASH] Custom Mob en Server

GreenTree0

Mineur des cavernes
25 Janvier 2019
54
2
28
Hey hey, alors afin d'en arriver à mon problème je vais expliquer les étapes par lesquelles je suis passé, tout d'abord j'ai eu l'idée d'un serveur sur un univers fictif que j'aimerai beaucoup crée, je me suis donc mis à rechercher comment je pourrai créer un mod qui implémenterait les mobs/items etc... de l'univers, et j'ai trouvé : MCreator !
J'ai donc commencer avec ça, ça marchait super bien, j'arrivais à faire mes trucs simplement en solo, puis viens le moment ou j'achète le serveur MtxServ, et la, PAF ! Crash :confused: :x, j'ai compris après que c'était lié au fait que MCreator ne supporte pas les serveurs, après y avoir dépenser des heures j'étais assez dégoûté, mais pas découragé.
J'ai donc continué et cette fois avec la programmation pure, j'ai installé Eclipse, et je me suis mis au Java, j'ai réussi à implémenter des items fonctionnels dans le serveur, donc j'étais super content, mais la, j'essaye d'ajouter un custom mob que j'ai crée (qui marche en solo) et PAF ! Crash :confused: :x
Le même que dans MCreator ! Je crois que c'est parce que mon mob ne fonctionne que sur le Client Side, j'ai donc recherché des infos partout, et depuis deux jours, je n'ai rien trouvé comme solution. J'ai cherché des tutos pour faire des custom mobs fonctionnels sur serveur : RIEN ! Donc je viens ici dans un dernier élan d'espoir xd Est-ce que quelqu'un pourrait m'expliquer comment je pourrai faire ça ? Merci d'avance !

Sinon si vous avez besoin, voila l'erreur fatidique :
Code:
[18:49:18] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from TestMod (mt)

Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/renderer/entity/Render
    at mod.test.util.handlers.RenderHandler.registerEntityRenders(RenderHandler.java:17) ~[bin/:?]
    at mod.test.util.handlers.RegistryHandler.preInitRegistries(RegistryHandler.java:17) ~[bin/:?]
    at mod.test.Main.PreInit(Main.java:26) ~[bin/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:626) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) ~[LoadController.class:?]
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:627) ~[Loader.class:?]
    at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99) ~[FMLServerHandler.class:?]
    at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:333) ~[FMLCommonHandler.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:128) ~[DedicatedServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:552) [MinecraftServer.class:?]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]
Caused by: java.lang.ClassNotFoundException: net.minecraft.client.renderer.entity.Render
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_201]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_201]
    at mod.test.util.handlers.RenderHandler.registerEntityRenders(RenderHandler.java:17) ~[bin/:?]
    at mod.test.util.handlers.RegistryHandler.preInitRegistries(RegistryHandler.java:17) ~[bin/:?]
    at mod.test.Main.PreInit(Main.java:26) ~[bin/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:626) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) ~[LoadController.class:?]
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:627) ~[Loader.class:?]
    at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99) ~[FMLServerHandler.class:?]
    at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:333) ~[FMLCommonHandler.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:128) ~[DedicatedServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:552) ~[MinecraftServer.class:?]
    at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_201]
Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@6e0cff20 from coremod FMLCorePlugin
    at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:260) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_201]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_201]
    at mod.test.util.handlers.RenderHandler.registerEntityRenders(RenderHandler.java:17) ~[bin/:?]
    at mod.test.util.handlers.RegistryHandler.preInitRegistries(RegistryHandler.java:17) ~[bin/:?]
    at mod.test.Main.PreInit(Main.java:26) ~[bin/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:626) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) ~[LoadController.class:?]
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:627) ~[Loader.class:?]
    at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99) ~[FMLServerHandler.class:?]
    at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:333) ~[FMLCommonHandler.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:128) ~[DedicatedServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:552) ~[MinecraftServer.class:?]
    at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_201]
Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/entity/Render for invalid side SERVER
    at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:62) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:256) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) ~[launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ~[launchwrapper-1.12.jar:?]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_201]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_201]
    at mod.test.util.handlers.RenderHandler.registerEntityRenders(RenderHandler.java:17) ~[bin/:?]
    at mod.test.util.handlers.RegistryHandler.preInitRegistries(RegistryHandler.java:17) ~[bin/:?]
    at mod.test.Main.PreInit(Main.java:26) ~[bin/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:626) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) ~[forgeSrc-1.12.2-14.23.5.2808.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_201]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_201]
    at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) ~[guava-21.0.jar:?]
    at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) ~[guava-21.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:217) ~[guava-21.0.jar:?]
    at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) ~[LoadController.class:?]
    at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:627) ~[Loader.class:?]
    at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:99) ~[FMLServerHandler.class:?]
    at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:333) ~[FMLCommonHandler.class:?]
    at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:128) ~[DedicatedServer.class:?]
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:552) ~[MinecraftServer.class:?]
    at java.lang.Thread.run(Unknown Source) ~[?:1.8.0_201]

Et en complémentaire voila mon RegistryHandler (Eclipse) :
Code:
ackage mod.test.util.handlers;
import mod.test.entity.EntityInit;
import mod.test.init.ModItems;
import mod.test.util.IHasModel;
import net.minecraft.item.Item;
import net.minecraftforge.client.event.ModelRegistryEvent;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@EventBusSubscriber
public class RegistryHandler {
    public static void preInitRegistries() {
        EntityInit.registerEntities();
        RenderHandler.registerEntityRenders();
      
    }
    @SubscribeEvent
    public static void onItemRegister(RegistryEvent.Register<Item> event) {
      
        event.getRegistry().registerAll(ModItems.ITEMS.toArray(new Item[0]));
    }
  
    @SubscribeEvent
    public static void onModelRegister(ModelRegistryEvent event) {
        for(Item item : ModItems.ITEMS)
        {
            if(item instanceof IHasModel)
            {
                ((IHasModel)item).registerModels();
            }
        }
    }
}

Et mon RenderHandler (Eclipse) :
Code:
package mod.test.util.handlers;
import mod.test.entity.FrenzyBoar;
import net.minecraft.entity.Entity;
import mod.test.entity.render.RenderFrenzyBoar;
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(FrenzyBoar.class, new IRenderFactory<FrenzyBoar>()
        {
            @Override
            public Render<? super FrenzyBoar> createRenderFor(RenderManager manager)
            {
                return new RenderFrenzyBoar(manager);
            }
        });
    }
}
 
Dernière édition:
La ligne 32 correspond à quelle ligne de ta classe main ?

cette ligne : proxy.registerRender();

Mais la je viens de modifier le code

Code:
package fr.blueziks_.cosmicmod;
import fr.blueziks_.cosmicmod.proxy.CommonProxy;
import fr.blueziks_.cosmicmod.tabs.CosmicTab;
import fr.blueziks_.cosmicmod.util.Reference;
import fr.blueziks_.cosmicmod.util.handlers.RegistryHandler;
import net.minecraft.creativetab.CreativeTabs;
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.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@Mod(modid = Reference.MOD_ID, name = Reference.NAME, version = Reference.VERSION)
public class Main 
{
    public static final CreativeTabs cosmictab = new CosmicTab("cosmictab");
    @Instance
    public static Main instance;
   
    @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.COMMON_PROXY_CLASS)
    public static CommonProxy proxy;
   
    @EventHandler
    public static void preInit(FMLPreInitializationEvent event)
    {
        RegistryHandler.preInitRegistries(event);
        proxy.registerRender();
    }
   
    @EventHandler
    public static void init(FMLInitializationEvent event)
    {
        RegistryHandler.initRegistries(event);
    }
   
    @EventHandler
    public static void postInit(FMLPostInitializationEvent event)
    {
        RegistryHandler.postInitRegistries(event);
    }
}

Et cette fois je n'ai pas de crash sur eclipse le jeu se lance , je vais tester immédiatement en multijoueur
 
La ligne 32 correspond à quelle ligne de ta classe main ?
Malgré mes modifications, le mod marche très bien en solo mais toujours la même erreur quand je démarre le serveur


Code:
 [11:16:50] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Cosmic Mod (cm)
Caused by: java.lang.NoClassDefFoundError: net.minecraft.client.renderer.entity.Render
at fr.blueziks_.cosmicmod.util.handlers.RenderHandler.registerEntityRenders(RenderHandler.java:17) ~[RenderHandler.class:?]
at fr.blueziks_.cosmicmod.util.handlers.RegistryHandler.preInitRegistries(RegistryHandler.java:67) ~[RegistryHandler.class:?]
at fr.blueziks_.cosmicmod.Main.preInit(Main.java:32) ~[Main.class:?]
 
Malgré mes modifications, le mod marche très bien en solo mais toujours la même erreur quand je démarre le serveur


Code:
 [11:16:50] [Server thread/ERROR] [net.minecraft.server.MinecraftServer]: Encountered an unexpected exception
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Cosmic Mod (cm)
Caused by: java.lang.NoClassDefFoundError: net.minecraft.client.renderer.entity.Render
at fr.blueziks_.cosmicmod.util.handlers.RenderHandler.registerEntityRenders(RenderHandler.java:17) ~[RenderHandler.class:?]
at fr.blueziks_.cosmicmod.util.handlers.RegistryHandler.preInitRegistries(RegistryHandler.java:67) ~[RegistryHandler.class:?]
at fr.blueziks_.cosmicmod.Main.preInit(Main.java:32) ~[Main.class:?]

Ligne 32 de mon Main : RegistryHandler.preInitRegistries(event);
Ligne 17 du RenderHandler : RenderingRegistry.registerEntityRenderingHandler(EntityCosmic.class, new IRenderFactory<EntityCosmic>()
Ligne 67 du RegistryHandler : RenderHandler.registerEntityRenders();
 
Ta fonction preInitRegistries doit être déplacé dans le client proxy, elle ne doit plus être dans le main.

Je dois déplacer tout le bloc dans Client Proxy?:
Code:
    @EventHandler
    public static void preInit(FMLPreInitializationEvent event)
    {
        RegistryHandler.preInitRegistries(event);
        proxy.registerRender();
    }
 
Non, uniquement l'appel à la fonction RegistryHandler.preInitRegistries
Okay je vois, mais comment l'ajouter sans erreur?
Mon ClientProxy :
Code:
package fr.blueziks_.cosmicmod.proxy;
import fr.blueziks_.cosmicmod.util.Reference;
import fr.blueziks_.cosmicmod.util.handlers.RegistryHandler;
import fr.blueziks_.cosmicmod.util.handlers.RenderHandler;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ModelLoader;
public class ClientProxy extends CommonProxy
{
    @Override
    public void registerRender() {
         RenderHandler.registerEntityRenders();
    } 
   
    public void registerItemRenderer(Item item, int meta, String id) 
    {
        ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(item.getRegistryName(), id));
    }
   
    @Override
    public void registerVariantRenderer(Item item, int meta, String filename, String id) 
    {
        ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(new ResourceLocation(Reference.MOD_ID, filename), id));
    }
   
    @Override
    public void registerModel(Item item, int metadata) 
    {
        ModelLoader.setCustomModelResourceLocation(item, metadata, new ModelResourceLocation(item.getRegistryName(), "inventory"));
    }
}
 
Si tu as vraiment besoin de FMLPreInitializationEventdans la fonction registerEntityRenders, il faut le passer en argument de ta fonction registerRender
Quand je retires le :
RegistryHandler.preInitRegistries(event); de ma classe Main, mon jeu me retires : le biome et l'entité, je sais pas vraiment quoi faire la je bloque
 
Je comprends pas pourquoi ça veux pas marcher en multi, quand le biome etc sont chargés sur le multi, boom crash (je vois un message dans la console comme quoi le biome est mis)