Résolu Lancement serveur : invalid dist DEDICATED_SERVER
-
Bonjour tout le monde, comme le titre l’indique j’ai un problème au lancement du serveur dédié pour mon mod “emomod, Emotion’s Mod”, je comprend que le problème est causé par mes Container côté serveur et je comprend également le principe des côtés, client / serveur, mais j’ai vraiment du mal à corriger cette erreur.
Pour l’histoire, je développe ce mod depuis maintenant 5 ou 6 ans et il commence vraiment à être costaud, j’ai actuellement 281 textures de bloc, 167 d’item, des biomes, des mechaniques de jeu, des dimensions, des entitées etc… Je l’adore mais je le garde privé pour l’instant (je l’enverrais bientôt en publique) et j’y retourne de temps en temps pour update la version (ce que j’ai vraiment du mal à faire, j’ai même dû réécrire complétement mon code au passage de la 1.8 vers 1.12 / 1.14…) ou pour rajouter du contenu.
Voilà les logs du serveur :
[27sept.2021 11:07:56.786] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevserver, --fml.mcpVersion, 20190829.143755, --fml.mcVersion, 1.14.4, --fml.forgeGroup, net.minecraftforge, --fml.forgeVersion, 28.2.0] [27sept.2021 11:07:56.789] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 4.1.0+62+5bfa59b starting: java version 1.8.0_302 by Temurin [27sept.2021 11:07:57.010] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust [27sept.2021 11:07:57.670] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevserver' with arguments [--gameDir, .] [27sept.2021 11:08:07.396] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498] [27sept.2021 11:08:07.397] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 11:08:07.398] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 11:08:07.398] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498] [27sept.2021 11:08:07.399] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 11:08:08.347] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer/]: Starting minecraft server version 1.14.4 [27sept.2021 11:08:08.590] [Server thread/FATAL] [net.minecraftforge.fml.loading.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER [27sept.2021 11:08:08.590] [Server thread/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Failed to load class fr.emotion.emomod.MainRegistry java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClass(RuntimeDistCleaner.java:71) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-launcher.jar:28.2] at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClass(ILaunchPluginService.java:102) ~[modlauncher-4.1.0.jar:4.1.0+62+5bfa59b] at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:80) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:115) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:241) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:128) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) ~[modlauncher-4.1.0.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_302] at java.lang.Class.forName0(Native Method) ~[?:1.8.0_302] at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLModContainer.<init>(FMLModContainer.java:71) ~[?:28.2] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:73) ~[?:28.2] at net.minecraftforge.fml.ModLoader.buildModContainerFromTOML(ModLoader.java:234) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$buildMods$26(ModLoader.java:214) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302] at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_302] at net.minecraftforge.fml.ModLoader.buildMods(ModLoader.java:216) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$18(ModLoader.java:173) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_302] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_302] at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) [?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) [?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) [?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) [?:1.8.0_302] at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:175) [?:?] at net.minecraftforge.fml.server.ServerModLoader.begin(ServerModLoader.java:45) [?:?] at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:124) [?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:622) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302] [27sept.2021 11:08:08.602] [Server thread/FATAL] [net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider/LOADING]: Unable to load FMLModContainer, wut? java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:73) ~[?:28.2] at net.minecraftforge.fml.ModLoader.buildModContainerFromTOML(ModLoader.java:234) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$buildMods$26(ModLoader.java:214) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302] at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_302] at net.minecraftforge.fml.ModLoader.buildMods(ModLoader.java:216) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$18(ModLoader.java:173) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_302] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_302] at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) [?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) [?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) [?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) [?:1.8.0_302] at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:175) [?:?] at net.minecraftforge.fml.server.ServerModLoader.begin(ServerModLoader.java:45) [?:?] at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:124) [?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:622) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302] Caused by: net.minecraftforge.fml.ModLoadingException: Emotion's Mod has class loading errors §7Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.javafmlmod.FMLModContainer.<init>(FMLModContainer.java:77) ~[?:28.2] ... 29 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClass(RuntimeDistCleaner.java:71) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-launcher.jar:28.2] at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClass(ILaunchPluginService.java:102) ~[modlauncher-4.1.0.jar:4.1.0+62+5bfa59b] at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:80) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:115) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:241) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:128) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) ~[modlauncher-4.1.0.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_302] at java.lang.Class.forName0(Native Method) ~[?:1.8.0_302] at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLModContainer.<init>(FMLModContainer.java:71) ~[?:28.2] ... 29 more [27sept.2021 11:08:08.604] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Encountered an unexpected exception java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:78) ~[?:28.2] at net.minecraftforge.fml.ModLoader.buildModContainerFromTOML(ModLoader.java:234) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$buildMods$26(ModLoader.java:214) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302] at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_302] at net.minecraftforge.fml.ModLoader.buildMods(ModLoader.java:216) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$18(ModLoader.java:173) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302] at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_302] at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:175) ~[?:?] at net.minecraftforge.fml.server.ServerModLoader.begin(ServerModLoader.java:45) ~[?:?] at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:124) ~[?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:622) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302] Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:73) ~[?:28.2] ... 24 more Caused by: net.minecraftforge.fml.ModLoadingException: Emotion's Mod has class loading errors §7Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.javafmlmod.FMLModContainer.<init>(FMLModContainer.java:77) ~[?:28.2] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:73) ~[?:28.2] ... 24 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClass(RuntimeDistCleaner.java:71) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-launcher.jar:28.2] at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClass(ILaunchPluginService.java:102) ~[modlauncher-4.1.0.jar:4.1.0+62+5bfa59b] at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:80) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:115) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:241) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:128) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) ~[modlauncher-4.1.0.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_302] at java.lang.Class.forName0(Native Method) ~[?:1.8.0_302] at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLModContainer.<init>(FMLModContainer.java:71) ~[?:28.2] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:73) ~[?:28.2] ... 24 more [27sept.2021 11:08:08.622] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: This crash report has been saved to: E:\Users\micka_000\Documents\Programmation\Minecraft\Emotion's Mod\1.14.3\Emomod\run\.\crash-reports\crash-2021-09-27_11.08.08-server.txt [27sept.2021 11:08:08.641] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Stopping server [27sept.2021 11:08:08.641] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving worlds [27sept.2021 11:08:08.644] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Exception stopping the server java.lang.IllegalArgumentException: Can not hotload overworld. This must be loaded at all times by main Server. at org.apache.commons.lang3.Validate.isTrue(Validate.java:158) ~[commons-lang3-3.8.1.jar:3.8.1] at net.minecraftforge.common.DimensionManager.initWorld(DimensionManager.java:226) ~[?:?] at net.minecraftforge.common.DimensionManager.getWorld(DimensionManager.java:195) ~[?:?] at net.minecraft.server.MinecraftServer.getWorld(MinecraftServer.java:1027) ~[?:?] at net.minecraft.server.MinecraftServer.save(MinecraftServer.java:536) ~[?:?] at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:571) ~[?:?] at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:596) ~[?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:685) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302]
J’enregistre les classes Biome, Block, ContainerType, TileEntityType etc… Dans des endroits differents que j’appelle par la suite dans la principale nommée “MainRegistry” avec la méthode init().
Premièrement, la classe où j’enregistre les ContainerType s’appelle sobrement “ContainerTypeRegistry” (convention personelle), j’ai actuellement trois types de Container, “CRAFTER” qui est une machine complexe d’artisanat automatique avec un hopper sur le dessus et le dessous pour les inputs / outputs, “BAG” qui est un sac simple qui permet de stocker des trucs en utilisant “ItemStackHandler” et pour finir “NIGHTSTAND” qui est un genre de coffre personnalisé avec 4 slots d’item et qui utilise differente couleur pour le GUI basé sur le bois utilisé, le code de cette classe :
@Mod.EventBusSubscriber(modid = MainRegistry.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class ContainerTypeRegistry { private static final List<ContainerType<?>> containerTypeList = new ArrayList<ContainerType<?>>(); public static final ContainerType<CrafterContainer> CRAFTER = IForgeContainerType.create((windowId, inv, data) -> { BlockPos pos = data.readBlockPos(); return new CrafterContainer(windowId, MainRegistry.proxy.getClientWorld(), pos, MainRegistry.proxy.getClientPlayer()); }); public static final ContainerType<BagContainer> BAG = IForgeContainerType.create((windowId, inv, data) -> { return new BagContainer(windowId, inv); }); public static final ContainerType<NightstandContainer> NIGHTSTAND = IForgeContainerType.create((windowId, inv, data) -> { BlockPos pos = data.readBlockPos(); return new NightstandContainer(windowId, inv.player.getEntityWorld(), pos, inv); }); public static void init() { addContainerType(CRAFTER, "crafter"); addContainerType(BAG, "bag"); addContainerType(NIGHTSTAND, "nightstand"); } public static void addContainerType(ContainerType<?> tet, String name) { containerTypeList.add(tet.setRegistryName(name)); } @SubscribeEvent public static void registerContainerType(final RegistryEvent.Register<ContainerType<?>> e) { for (ContainerType<?> tet : containerTypeList) { e.getRegistry().register(tet); } } }
Ensuite, j’utilise la même technique pour enregistrer mes TileEntityType et j’appelle toutes ces méthodes init mais aussi ScreenManager.registerFactory(), comme je l’ai dis, dans ma classe principal juste ici :
@Mod(MainRegistry.MOD_ID) public class MainRegistry { public static final String MOD_ID = "emomod"; public static final Logger LOGGER = LogManager.getLogger(MOD_ID); public static IProxy proxy = DistExecutor.runForDist(() -> () -> new ClientProxy(), () -> () -> new ServerProxy()); public static MainRegistry instance; public static WorldType PARCEL_TYPE = new ParcelWorldType(); public static WorldType DREAM_TYPE = new DreamWorldType(); public MainRegistry() { ItemRegistry.init(); BlockRegistry.init(); TileEntityTypeRegistry.init(); EntityTypeRegistry.init(); SurfaceBuilderRegistry.init(); PlacementRegistry.init(); FeatureRegistry.init(); FluidRegistry.init(); ContainerTypeRegistry.init(); DispenserBlock.registerDispenseBehavior(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), Potions.WATER).getItem(), new IInteractBehavior()); DispenserBlock.registerDispenseBehavior(Items.WHEAT_SEEDS, new IPlaceBehavior(Blocks.WHEAT, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.PUMPKIN_SEEDS, new IPlaceBehavior(Blocks.PUMPKIN_STEM, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.MELON_SEEDS, new IPlaceBehavior(Blocks.MELON_STEM, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.BEETROOT_SEEDS, new IPlaceBehavior(Blocks.BEETROOTS, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.CARROT, new IPlaceBehavior(Blocks.CARROTS, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.POTATO, new IPlaceBehavior(Blocks.POTATOES, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.OAK_SAPLING, new IPlaceBehavior(Blocks.OAK_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.ACACIA_SAPLING, new IPlaceBehavior(Blocks.ACACIA_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.BIRCH_SAPLING, new IPlaceBehavior(Blocks.BIRCH_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.DARK_OAK_SAPLING, new IPlaceBehavior(Blocks.DARK_OAK_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.JUNGLE_SAPLING, new IPlaceBehavior(Blocks.JUNGLE_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.SPRUCE_SAPLING, new IPlaceBehavior(Blocks.SPRUCE_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.BAMBOO, new IPlaceBehavior(Blocks.BAMBOO_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.NETHER_WART, new IPlaceBehavior(Blocks.NETHER_WART, Blocks.SOUL_SAND, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::serverSetup); MinecraftForge.EVENT_BUS.register(new EmotionOverlayEvent()); MinecraftForge.EVENT_BUS.register(new EmotionLivingEvent()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySign.class, new TileEntitySignRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrafter.class, new TileEntityCrafterRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPot.class, new TileEntityPotRenderer()); LootConditionManager.registerCondition(new HarvestLevelCondition.Serializer()); EmomodPacketHandler.registerMessages(); } private void setup(final FMLCommonSetupEvent e) { proxy.init(); RenderingRegistry.registerEntityRenderingHandler(OrbSpellEntity.class, render -> new SpriteRenderer<OrbSpellEntity>(render, Minecraft.getInstance().getItemRenderer())); RenderingRegistry.registerEntityRenderingHandler(EntityButterfly.class, render -> new RendererButterfly(render)); RenderingRegistry.registerEntityRenderingHandler(EntityBeetle.class, render -> new RendererBasic<EntityBeetle, ModelBeetle>(render, new ModelBeetle(), 0.175f, new ResourceLocation(MainRegistry.MOD_ID, "textures/entity/beetle.png"))); RenderingRegistry.registerEntityRenderingHandler(EntityLightningBug.class, render -> new RendererBasic<EntityLightningBug, ModelLightningBug>(render, new ModelLightningBug(), 0.0f, new ResourceLocation(MainRegistry.MOD_ID, "textures/entity/lightning_bug.png"))); RenderingRegistry.registerEntityRenderingHandler(EntityBoat.class, RendererBoat::new); RenderingRegistry.registerEntityRenderingHandler(EntityChubby.class, render -> new RendererBasic<EntityChubby, ModelChubby>(render, new ModelChubby(), .2f, new ResourceLocation(MainRegistry.MOD_ID, "textures/entity/chubby.png"))); RenderingRegistry.registerEntityRenderingHandler(EntityMouse.class, render -> new RendererMouse(render, new ModelMouse(), 0.1f)); RenderingRegistry.registerEntityRenderingHandler(EntityOrchardSpider.class, render -> new RendererOrchardSpider<EntityOrchardSpider>(render)); EmoOreGeneration.setupOreGeneration(); // RecipeRegistry.init(); } private void clientSetup(final FMLClientSetupEvent e) { EmoStaff staff = (EmoStaff) ItemRegistry.PURPURA_STAFF; Minecraft.getInstance().getItemColors().register((item, tintIndex) -> { return staff.getColor(new ItemStack(staff), tintIndex); }, staff); Minecraft.getInstance().getItemColors().register((item, tintIndex) -> { return GrassColors.get(0.5D, 1.0D); }, BlockRegistry.FLOWER_TALLGRASS); Minecraft.getInstance().getItemColors().register((item, tintIndex) -> { BlockState blockstate = ((BlockItem) item.getItem()).getBlock().getDefaultState(); return Minecraft.getInstance().getBlockColors().getColor(blockstate, (IEnviromentBlockReader) null, (BlockPos) null, tintIndex); }, BlockRegistry.LEAVES_CHERRY, BlockRegistry.LEAVES_PEAR, BlockRegistry.LEAVES_ORANGE, BlockRegistry.LEAVES_ATLAS, BlockRegistry.LEAVES_PINE, BlockRegistry.LEAVES_COCO, BlockRegistry.LEAVES_DREAM); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return reader != null && pos != null ? BiomeColors.getGrassColor(reader, pos) : GrassColors.get(0.5D, 1.0D); }, BlockRegistry.FLOWER_TALLGRASS); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return reader != null && pos != null ? BiomeColors.getFoliageColor(reader, pos) : FoliageColors.getDefault(); }, BlockRegistry.LEAVES_PINE, BlockRegistry.LEAVES_COCO, BlockRegistry.LEAVES_DREAM); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0xac73af; }, BlockRegistry.LEAVES_CHERRY); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0x487748; }, BlockRegistry.LEAVES_PEAR); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0x45a14a; }, BlockRegistry.LEAVES_ORANGE); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0x4496c4; }, BlockRegistry.LEAVES_ATLAS); ScreenManager.<CrafterContainer, CrafterScreen>registerFactory(ContainerTypeRegistry.CRAFTER, (container, playerInventory, title) -> { return new CrafterScreen(container, playerInventory, title); }); ScreenManager.<BagContainer, BagScreen>registerFactory(ContainerTypeRegistry.BAG, (container, playerInventory, title) -> { return new BagScreen(container, playerInventory, title); }); ScreenManager.<NightstandContainer, NightstandScreen>registerFactory(ContainerTypeRegistry.NIGHTSTAND, (container, playerInventory, title) -> { return new NightstandScreen(container, playerInventory, title, container.getTileEntity().getColor()); }); } private void serverSetup(final FMLDedicatedServerSetupEvent e) { } }
Enfin, pour les classes spécifiques aux types de Container je ne vais envoyer que celles correspantes à “NIGHTSTAND” dans n’importe quel ordre :
- Classe du Block :
public class EmoNightstand extends Block { private static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; private static final VoxelShape NIGHTSTAND_SHAPE = Block.makeCuboidShape(1.0D, 0.0D, 1.0D, 15.0D, 15.0D, 15.0D); private float[] color; public EmoNightstand(Properties properties, float[] color) { super(properties); this.getDefaultState().with(FACING, Direction.NORTH); this.color = color; } @Override public VoxelShape getCollisionShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { return NIGHTSTAND_SHAPE; } @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { return NIGHTSTAND_SHAPE; } @Override public boolean onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!worldIn.isRemote) { TileEntity tileEntity = worldIn.getTileEntity(pos); if (tileEntity instanceof INamedContainerProvider) { NetworkHooks.openGui((ServerPlayerEntity) player, (INamedContainerProvider) tileEntity, tileEntity.getPos()); } } return true; } public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); } protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { builder.add(FACING); } @Override public boolean hasTileEntity(BlockState state) { return true; } @Override public TileEntity createTileEntity(BlockState state, IBlockReader world) { return new TileEntityNightstand(this.color); } }
- Classe du TileEntity :
public class TileEntityNightstand extends TileEntity implements INamedContainerProvider { private LazyOptional<IItemHandler> handler = LazyOptional.of(this::createHandler); private float[] color = new float[] { 0.0f, 255.0f, 0.0f}; public TileEntityNightstand(float[] color) { this(); this.color = color; } public TileEntityNightstand() { super(TileEntityTypeRegistry.NIGHTSTAND); } @SuppressWarnings("unchecked") @Override public void read(CompoundNBT compound) { CompoundNBT inventory = compound.getCompound("Inventory"); handler.ifPresent(h -> ((INBTSerializable<CompoundNBT>) h).deserializeNBT(inventory)); super.read(compound); } @SuppressWarnings("unchecked") @Override public CompoundNBT write(CompoundNBT compound) { handler.ifPresent(h -> { CompoundNBT nbt = ((INBTSerializable<CompoundNBT>) h).serializeNBT(); compound.put("Inventory", nbt); }); return super.write(compound); } private IItemHandler createHandler() { return new ItemStackHandler(4) { @Override protected void onContentsChanged(int slot) { markDirty(); } }; } @Override public <T> LazyOptional<T> getCapability(Capability<T> cap, Direction side) { if (cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return handler.cast(); return super.getCapability(cap, side); } @Override public ITextComponent getDisplayName() { return new TranslationTextComponent("container.emomod.nightstand"); } @Override public Container createMenu(int windowId, PlayerInventory playerInventory, PlayerEntity player) { return new NightstandContainer(windowId, this.getWorld(), this.getPos(), playerInventory); } public float[] getColor() { return this.color; } }
- Classe du ContainerScreen :
public class NightstandScreen extends ContainerScreen<NightstandContainer> { private static final ResourceLocation NIGHTSTAND_GUI_SCREEN = new ResourceLocation(MainRegistry.MOD_ID, "textures/gui/container/nightstand.png"); private float[] color; public NightstandScreen(NightstandContainer screenContainer, PlayerInventory playerInventory, ITextComponent titleIn, float[] color) { super(screenContainer, playerInventory, titleIn); this.xSize = 176; this.ySize = 127; this.color = color; } protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { this.font.drawString(this.getTitle().getFormattedText(), 8, 4, 0); this.font.drawString(this.playerInventory.getDisplayName().getFormattedText(), 8.0F, (float) (this.ySize - 96 + 2), 0); } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { int xPos = (this.width - this.xSize) / 2; int yPos = (this.height - this.ySize) / 2; GlStateManager.color4f(1.0f, 1.0f, 1.0f, 1.0f); this.minecraft.getTextureManager().bindTexture(NIGHTSTAND_GUI_SCREEN); this.blit(xPos, yPos, 0, 0, this.xSize, this.ySize); GlStateManager.color4f(color[0] / 255, color[1] / 255, color[2] / 255, 1.0f); this.blit(xPos, yPos, 0, 0, this.xSize, this.ySize); GlStateManager.disableTexture(); GlStateManager.enableBlend(); GlStateManager.disableAlphaTest(); GlStateManager.blendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO); GlStateManager.shadeModel(7425); Tessellator tessellator = Tessellator.getInstance(); BufferBuilder bufferbuilder = tessellator.getBuffer(); bufferbuilder.begin(7, DefaultVertexFormats.POSITION_COLOR); bufferbuilder.pos((double) xPos + this.xSize, (double) yPos, (double) this.blitOffset).color(0, 0, 0, 0).endVertex(); bufferbuilder.pos((double) xPos, (double) yPos, (double) this.blitOffset).color(0, 0, 0, 0).endVertex(); bufferbuilder.pos((double) xPos, (double) yPos + this.ySize, (double) this.blitOffset).color(0, 0, 0, 255 / 2).endVertex(); bufferbuilder.pos((double) xPos + this.xSize, (double) yPos + this.ySize, (double) this.blitOffset).color(0, 0, 0, 255 / 2).endVertex(); tessellator.draw(); GlStateManager.shadeModel(7424); GlStateManager.disableBlend(); GlStateManager.enableAlphaTest(); GlStateManager.enableTexture(); } }
*Classe du Container :
public class NightstandContainer extends Container { private TileEntity tileEntity; private int containerSlots = 0; public NightstandContainer(int id, World world, BlockPos pos, PlayerInventory playerInventory) { super(ContainerTypeRegistry.NIGHTSTAND, id); this.tileEntity = world.getTileEntity(pos); tileEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).ifPresent(h -> { containerSlots = h.getSlots(); for (int i = 0; i < h.getSlots(); i++) { addSlot(new SlotItemHandler(h, i, 44 + (i * 18) + (i > 1 ? 18 : 0), 14)); } }); for (int y = 0; y < 3; ++y) { for (int x = 0; x < 9; ++x) { this.addSlot(new Slot(playerInventory, x + y * 9 + 9, 8 + (x * 18), 45 + (y * 18))); } } for (int k = 0; k < 9; ++k) { this.addSlot(new Slot(playerInventory, k, 8 + k * 18, 103)); } } @Override public ItemStack transferStackInSlot(PlayerEntity playerIn, int index) { Slot slot = this.getSlot(index); if (!slot.canTakeStack(playerIn)) return slot.getStack(); if (!slot.getHasStack()) return ItemStack.EMPTY; ItemStack stack = slot.getStack(); ItemStack newStack = stack.copy(); if (index < containerSlots) { if (!this.mergeItemStack(stack, containerSlots, this.inventorySlots.size(), true)) return ItemStack.EMPTY; slot.onSlotChanged(); } else if (!this.mergeItemStack(stack, 0, containerSlots, false)) return ItemStack.EMPTY; if (stack.isEmpty()) slot.putStack(ItemStack.EMPTY); else slot.onSlotChanged(); return slot.onTake(playerIn, newStack); } @Override public boolean canInteractWith(PlayerEntity playerIn) { return this.isUsable(playerIn); } protected boolean isUsable(PlayerEntity playerIn) { return IWorldPosCallable.of(tileEntity.getWorld(), tileEntity.getPos()).applyOrElse((block, pos) -> { return !(block.getBlockState(pos).getBlock() instanceof EmoNightstand) ? false : playerIn.getDistanceSq((double) pos.getX() + 0.5D, (double) pos.getY() + 0.5D, (double) pos.getZ() + 0.5D) <= 64.0D; }, true); } @Nullable public TileEntityNightstand getTileEntity() { if (this.tileEntity instanceof TileEntityNightstand) return (TileEntityNightstand) this.tileEntity; else return null; } }
Et voilà, je crois que j’ai tous envoyé, je vous remercie par avance de l’aide que vous pourriez me fournir, c’est un mod qui compte beaucoup pour moi et sur lequel j’ai énormement travaillé durant les années, je devrais bientôt l’update dans la version la plus récente (j’aurais d’ailleurs sûrement besoin d’aide pour ça aussi, moyennent finances si c’est possible ici dans une section recrutement) et j’arrêterais d’ajouter du nouveau contenu pour me concentrer sur la finitation des choses déjà existantes pour enfin le rendre publique.
Merci encore d’avoir pris le temps de lire tout ça sur votre temps libre, je pourrais si jamais envoyer le jar du mod en WIP en tant que demo si des gens sont interessés et si j’arrive à résoudre ce problème mais également si j’arrive à proteger mes images pour éviter la réutilisation, modification et copie.
-
Ajoutes un
@OnlyIn(Dist.CLIENT)
au dessus de ton client setup, il faut être qu’il ne va pas essayer de charger tes TileEntitySpecialRenderer, sinon cela crash. -
Bonjour,
Le problème vient des
ClientRegistry.bindTileEntitySpecialRenderer
, ils doivent être dans une fonction client uniquement et non à un endroit qui est appelé à la fois par le client et le serveur. -
Bonjour Robin,
Après avoir déplacé l’appelle des fonctions ClientRegistry.bindTileEntitySpecialRender() dans la section :
private void clientSetup(final FMLClientSetupEvent e) {}
Je crois que le log est similaire :
[27sept.2021 14:06:45.692] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevserver, --fml.mcpVersion, 20190829.143755, --fml.mcVersion, 1.14.4, --fml.forgeGroup, net.minecraftforge, --fml.forgeVersion, 28.2.0] [27sept.2021 14:06:45.695] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 4.1.0+62+5bfa59b starting: java version 1.8.0_302 by Temurin [27sept.2021 14:06:45.918] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust [27sept.2021 14:06:46.583] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevserver' with arguments [--gameDir, .] [27sept.2021 14:06:56.232] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498] [27sept.2021 14:06:56.233] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 14:06:56.233] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 14:06:56.234] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498] [27sept.2021 14:06:56.235] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 14:06:57.225] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer/]: Starting minecraft server version 1.14.4 [27sept.2021 14:06:57.454] [Server thread/FATAL] [net.minecraftforge.fml.loading.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER [27sept.2021 14:06:57.454] [Server thread/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Failed to load class fr.emotion.emomod.MainRegistry java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClass(RuntimeDistCleaner.java:71) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-launcher.jar:28.2] at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClass(ILaunchPluginService.java:102) ~[modlauncher-4.1.0.jar:4.1.0+62+5bfa59b] at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:80) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:115) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:241) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:128) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) ~[modlauncher-4.1.0.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_302] at java.lang.Class.forName0(Native Method) ~[?:1.8.0_302] at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLModContainer.<init>(FMLModContainer.java:71) ~[?:28.2] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:73) ~[?:28.2] at net.minecraftforge.fml.ModLoader.buildModContainerFromTOML(ModLoader.java:234) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$buildMods$26(ModLoader.java:214) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302] at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_302] at net.minecraftforge.fml.ModLoader.buildMods(ModLoader.java:216) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$18(ModLoader.java:173) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_302] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_302] at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) [?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) [?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) [?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) [?:1.8.0_302] at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:175) [?:?] at net.minecraftforge.fml.server.ServerModLoader.begin(ServerModLoader.java:45) [?:?] at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:124) [?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:622) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302] [27sept.2021 14:06:57.462] [Server thread/FATAL] [net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider/LOADING]: Unable to load FMLModContainer, wut? java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:73) ~[?:28.2] at net.minecraftforge.fml.ModLoader.buildModContainerFromTOML(ModLoader.java:234) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$buildMods$26(ModLoader.java:214) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302] at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_302] at net.minecraftforge.fml.ModLoader.buildMods(ModLoader.java:216) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$18(ModLoader.java:173) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_302] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_302] at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) [?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) [?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) [?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) [?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) [?:1.8.0_302] at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:175) [?:?] at net.minecraftforge.fml.server.ServerModLoader.begin(ServerModLoader.java:45) [?:?] at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:124) [?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:622) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302] Caused by: net.minecraftforge.fml.ModLoadingException: Emotion's Mod has class loading errors §7Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.javafmlmod.FMLModContainer.<init>(FMLModContainer.java:77) ~[?:28.2] ... 29 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClass(RuntimeDistCleaner.java:71) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-launcher.jar:28.2] at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClass(ILaunchPluginService.java:102) ~[modlauncher-4.1.0.jar:4.1.0+62+5bfa59b] at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:80) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:115) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:241) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:128) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) ~[modlauncher-4.1.0.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_302] at java.lang.Class.forName0(Native Method) ~[?:1.8.0_302] at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLModContainer.<init>(FMLModContainer.java:71) ~[?:28.2] ... 29 more [27sept.2021 14:06:57.464] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Encountered an unexpected exception java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:78) ~[?:28.2] at net.minecraftforge.fml.ModLoader.buildModContainerFromTOML(ModLoader.java:234) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$buildMods$26(ModLoader.java:214) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302] at java.util.HashMap$EntrySpliterator.forEachRemaining(HashMap.java:1699) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_302] at net.minecraftforge.fml.ModLoader.buildMods(ModLoader.java:216) ~[?:?] at net.minecraftforge.fml.ModLoader.lambda$gatherAndInitializeMods$18(ModLoader.java:173) ~[?:?] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_302] at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_302] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566) ~[?:1.8.0_302] at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:175) ~[?:?] at net.minecraftforge.fml.server.ServerModLoader.begin(ServerModLoader.java:45) ~[?:?] at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:124) ~[?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:622) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302] Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:73) ~[?:28.2] ... 24 more Caused by: net.minecraftforge.fml.ModLoadingException: Emotion's Mod has class loading errors §7Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.javafmlmod.FMLModContainer.<init>(FMLModContainer.java:77) ~[?:28.2] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:73) ~[?:28.2] ... 24 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/tileentity/TileEntityRenderer for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClass(RuntimeDistCleaner.java:71) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-launcher.jar:28.2] at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClass(ILaunchPluginService.java:102) ~[modlauncher-4.1.0.jar:4.1.0+62+5bfa59b] at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:80) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:115) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:241) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:128) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) ~[modlauncher-4.1.0.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_302] at java.lang.Class.forName0(Native Method) ~[?:1.8.0_302] at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLModContainer.<init>(FMLModContainer.java:71) ~[?:28.2] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLJavaModLanguageProvider$FMLModTarget.loadMod(FMLJavaModLanguageProvider.java:73) ~[?:28.2] ... 24 more [27sept.2021 14:06:57.481] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: This crash report has been saved to: E:\Users\micka_000\Documents\Programmation\Minecraft\Emotion's Mod\1.14.3\Emomod\run\.\crash-reports\crash-2021-09-27_14.06.57-server.txt [27sept.2021 14:06:57.497] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Stopping server [27sept.2021 14:06:57.497] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving worlds [27sept.2021 14:06:57.500] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Exception stopping the server java.lang.IllegalArgumentException: Can not hotload overworld. This must be loaded at all times by main Server. at org.apache.commons.lang3.Validate.isTrue(Validate.java:158) ~[commons-lang3-3.8.1.jar:3.8.1] at net.minecraftforge.common.DimensionManager.initWorld(DimensionManager.java:226) ~[?:?] at net.minecraftforge.common.DimensionManager.getWorld(DimensionManager.java:195) ~[?:?] at net.minecraft.server.MinecraftServer.getWorld(MinecraftServer.java:1027) ~[?:?] at net.minecraft.server.MinecraftServer.save(MinecraftServer.java:536) ~[?:?] at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:571) ~[?:?] at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:596) ~[?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:685) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302]
-
Ajoutes un
@OnlyIn(Dist.CLIENT)
au dessus de ton client setup, il faut être qu’il ne va pas essayer de charger tes TileEntitySpecialRenderer, sinon cela crash. -
En parlant de la balise @OnlyIn(Dist.CLIENT) je me suis rendu compte que je l’avais complétement oublié, j’ai corrigé le tir est l’ai ajouté sur tous mes Model, Renderer, ContainerScreen et également sur la fonction getColor() de mon item EmoStaff, j’ai également déplacé RenderingRegistry.registerEntityRenderingHandler() dans la section :
@OnlyIn(Dist.CLIENT) private void clientSetup(final FMLClientSetupEvent e) { }
Ma classe principal ressemble donc maintenant à ça :
@Mod(MainRegistry.MOD_ID) public class MainRegistry { public static final String MOD_ID = "emomod"; public static final Logger LOGGER = LogManager.getLogger(MOD_ID); public static IProxy proxy = DistExecutor.runForDist(() -> () -> new ClientProxy(), () -> () -> new ServerProxy()); public static MainRegistry instance; public static WorldType PARCEL_TYPE = new ParcelWorldType(); public static WorldType DREAM_TYPE = new DreamWorldType(); public MainRegistry() { ItemRegistry.init(); BlockRegistry.init(); TileEntityTypeRegistry.init(); EntityTypeRegistry.init(); SurfaceBuilderRegistry.init(); PlacementRegistry.init(); FeatureRegistry.init(); FluidRegistry.init(); ContainerTypeRegistry.init(); DispenserBlock.registerDispenseBehavior(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), Potions.WATER).getItem(), new IInteractBehavior()); DispenserBlock.registerDispenseBehavior(Items.WHEAT_SEEDS, new IPlaceBehavior(Blocks.WHEAT, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.PUMPKIN_SEEDS, new IPlaceBehavior(Blocks.PUMPKIN_STEM, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.MELON_SEEDS, new IPlaceBehavior(Blocks.MELON_STEM, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.BEETROOT_SEEDS, new IPlaceBehavior(Blocks.BEETROOTS, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.CARROT, new IPlaceBehavior(Blocks.CARROTS, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.POTATO, new IPlaceBehavior(Blocks.POTATOES, Blocks.FARMLAND)); DispenserBlock.registerDispenseBehavior(Items.OAK_SAPLING, new IPlaceBehavior(Blocks.OAK_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.ACACIA_SAPLING, new IPlaceBehavior(Blocks.ACACIA_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.BIRCH_SAPLING, new IPlaceBehavior(Blocks.BIRCH_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.DARK_OAK_SAPLING, new IPlaceBehavior(Blocks.DARK_OAK_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.JUNGLE_SAPLING, new IPlaceBehavior(Blocks.JUNGLE_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.SPRUCE_SAPLING, new IPlaceBehavior(Blocks.SPRUCE_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.BAMBOO, new IPlaceBehavior(Blocks.BAMBOO_SAPLING, Blocks.GRASS_BLOCK, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); DispenserBlock.registerDispenseBehavior(Items.NETHER_WART, new IPlaceBehavior(Blocks.NETHER_WART, Blocks.SOUL_SAND, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.PODZOL)); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientSetup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::serverSetup); MinecraftForge.EVENT_BUS.register(new EmotionOverlayEvent()); MinecraftForge.EVENT_BUS.register(new EmotionLivingEvent()); LootConditionManager.registerCondition(new HarvestLevelCondition.Serializer()); EmomodPacketHandler.registerMessages(); } private void setup(final FMLCommonSetupEvent e) { proxy.init(); EmoOreGeneration.setupOreGeneration(); // RecipeRegistry.init(); } @OnlyIn(Dist.CLIENT) private void clientSetup(final FMLClientSetupEvent e) { RenderingRegistry.registerEntityRenderingHandler(OrbSpellEntity.class, render -> new SpriteRenderer<OrbSpellEntity>(render, Minecraft.getInstance().getItemRenderer())); RenderingRegistry.registerEntityRenderingHandler(EntityButterfly.class, render -> new RendererButterfly(render)); RenderingRegistry.registerEntityRenderingHandler(EntityBeetle.class, render -> new RendererBasic<EntityBeetle, ModelBeetle>(render, new ModelBeetle(), 0.175f, new ResourceLocation(MainRegistry.MOD_ID, "textures/entity/beetle.png"))); RenderingRegistry.registerEntityRenderingHandler(EntityLightningBug.class, render -> new RendererBasic<EntityLightningBug, ModelLightningBug>(render, new ModelLightningBug(), 0.0f, new ResourceLocation(MainRegistry.MOD_ID, "textures/entity/lightning_bug.png"))); RenderingRegistry.registerEntityRenderingHandler(EntityBoat.class, RendererBoat::new); RenderingRegistry.registerEntityRenderingHandler(EntityChubby.class, render -> new RendererBasic<EntityChubby, ModelChubby>(render, new ModelChubby(), .2f, new ResourceLocation(MainRegistry.MOD_ID, "textures/entity/chubby.png"))); RenderingRegistry.registerEntityRenderingHandler(EntityMouse.class, render -> new RendererMouse(render, new ModelMouse(), 0.1f)); RenderingRegistry.registerEntityRenderingHandler(EntityOrchardSpider.class, render -> new RendererOrchardSpider<EntityOrchardSpider>(render)); ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySign.class, new TileEntitySignRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrafter.class, new TileEntityCrafterRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPot.class, new TileEntityPotRenderer()); EmoStaff staff = (EmoStaff) ItemRegistry.PURPURA_STAFF; Minecraft.getInstance().getItemColors().register((item, tintIndex) -> { return staff.getColor(new ItemStack(staff), tintIndex); }, staff); Minecraft.getInstance().getItemColors().register((item, tintIndex) -> { return GrassColors.get(0.5D, 1.0D); }, BlockRegistry.FLOWER_TALLGRASS); Minecraft.getInstance().getItemColors().register((item, tintIndex) -> { BlockState blockstate = ((BlockItem) item.getItem()).getBlock().getDefaultState(); return Minecraft.getInstance().getBlockColors().getColor(blockstate, (IEnviromentBlockReader) null, (BlockPos) null, tintIndex); }, BlockRegistry.LEAVES_CHERRY, BlockRegistry.LEAVES_PEAR, BlockRegistry.LEAVES_ORANGE, BlockRegistry.LEAVES_ATLAS, BlockRegistry.LEAVES_PINE, BlockRegistry.LEAVES_COCO, BlockRegistry.LEAVES_DREAM); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return reader != null && pos != null ? BiomeColors.getGrassColor(reader, pos) : GrassColors.get(0.5D, 1.0D); }, BlockRegistry.FLOWER_TALLGRASS); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return reader != null && pos != null ? BiomeColors.getFoliageColor(reader, pos) : FoliageColors.getDefault(); }, BlockRegistry.LEAVES_PINE, BlockRegistry.LEAVES_COCO, BlockRegistry.LEAVES_DREAM); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0xac73af; }, BlockRegistry.LEAVES_CHERRY); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0x487748; }, BlockRegistry.LEAVES_PEAR); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0x45a14a; }, BlockRegistry.LEAVES_ORANGE); Minecraft.getInstance().getBlockColors().register((state, reader, pos, color) -> { return 0x4496c4; }, BlockRegistry.LEAVES_ATLAS); ScreenManager.<CrafterContainer, CrafterScreen>registerFactory(ContainerTypeRegistry.CRAFTER, (container, playerInventory, title) -> { return new CrafterScreen(container, playerInventory, title); }); ScreenManager.<BagContainer, BagScreen>registerFactory(ContainerTypeRegistry.BAG, (container, playerInventory, title) -> { return new BagScreen(container, playerInventory, title); }); ScreenManager.<NightstandContainer, NightstandScreen>registerFactory(ContainerTypeRegistry.NIGHTSTAND, (container, playerInventory, title) -> { return new NightstandScreen(container, playerInventory, title, container.getTileEntity().getColor()); }); } private void serverSetup(final FMLDedicatedServerSetupEvent e) { } }
Les logs ont changés (beaucoup plus petit), je crois réussir à comprendre que c’est maintenant la couleur de l’item qui pose probléme, or j’ai déjà ajouté la balise comme dis précedemment à la méthode getColor()… Le log :
[27sept.2021 15:12:56.676] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevserver, --fml.mcpVersion, 20190829.143755, --fml.mcVersion, 1.14.4, --fml.forgeGroup, net.minecraftforge, --fml.forgeVersion, 28.2.0] [27sept.2021 15:12:56.678] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 4.1.0+62+5bfa59b starting: java version 1.8.0_302 by Temurin [27sept.2021 15:12:56.889] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust [27sept.2021 15:12:57.534] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevserver' with arguments [--gameDir, .] [27sept.2021 15:13:07.091] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498] [27sept.2021 15:13:07.092] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 15:13:07.092] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 15:13:07.093] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498] [27sept.2021 15:13:07.094] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 15:13:08.077] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer/]: Starting minecraft server version 1.14.4 [27sept.2021 15:13:08.350] [modloading-worker-11/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 28.2.0, for MC 1.14.4 with MCP 20190829.143755 [27sept.2021 15:13:08.351] [modloading-worker-11/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v28.2.0 Initialized [27sept.2021 15:13:08.359] [modloading-worker-9/FATAL] [net.minecraftforge.fml.loading.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/renderer/color/IItemColor for invalid dist DEDICATED_SERVER [27sept.2021 15:13:08.359] [modloading-worker-9/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Failed to create mod instance. ModID: emomod, class fr.emotion.emomod.MainRegistry java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/color/IItemColor for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClass(RuntimeDistCleaner.java:71) ~[forge-1.14.4-28.2.0_mapped_snapshot_20190719-1.14.3-launcher.jar:28.2] at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClass(ILaunchPluginService.java:102) ~[modlauncher-4.1.0.jar:4.1.0+62+5bfa59b] at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:80) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:115) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:241) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:128) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) ~[modlauncher-4.1.0.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_302] at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_302] at java.lang.ClassLoader.defineClass(ClassLoader.java:756) ~[?:1.8.0_302] at java.lang.ClassLoader.defineClass(ClassLoader.java:635) ~[?:1.8.0_302] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:129) ~[modlauncher-4.1.0.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:98) ~[modlauncher-4.1.0.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ~[?:1.8.0_302] at fr.emotion.emomod.MainRegistry.<init>(MainRegistry.java:101) ~[?:?] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:131) ~[?:28.2] at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_302] at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_302] at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) ~[?:?] at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:134) ~[?:?] at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:1.8.0_302] at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_302] at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290) ~[?:1.8.0_302] at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) ~[?:1.8.0_302] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_302] at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:401) ~[?:1.8.0_302] at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734) ~[?:1.8.0_302] at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159) ~[?:1.8.0_302] at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:650) ~[?:1.8.0_302] at net.minecraftforge.fml.ModList.lambda$dispatchParallelEvent$11(ModList.java:134) ~[?:?] at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386) [?:1.8.0_302] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_302] at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_302] at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_302] at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) [?:1.8.0_302] [27sept.2021 15:13:08.466] [Server thread/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event CONSTRUCT, 1 errors found [27sept.2021 15:13:08.467] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Encountered an unexpected exception net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [ Emotion's Mod (emomod) has failed to load correctly §7Attempted to load class net/minecraft/client/renderer/color/IItemColor for invalid dist DEDICATED_SERVER ] at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:201) ~[?:?] at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:183) ~[?:?] at net.minecraftforge.fml.server.ServerModLoader.begin(ServerModLoader.java:45) ~[?:?] at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:124) ~[?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:622) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302] [27sept.2021 15:13:08.477] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: This crash report has been saved to: E:\Users\micka_000\Documents\Programmation\Minecraft\Emotion's Mod\1.14.3\Emomod\run\.\crash-reports\crash-2021-09-27_15.13.08-server.txt [27sept.2021 15:13:08.491] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Stopping server [27sept.2021 15:13:08.491] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving worlds [27sept.2021 15:13:08.491] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Exception stopping the server java.lang.RuntimeException: The server has failed to initialize correctly due to mod loading errors. Examine the crash report for more details. at net.minecraftforge.common.DimensionManager.getWorld(DimensionManager.java:182) ~[?:?] at net.minecraft.server.MinecraftServer.getWorld(MinecraftServer.java:1027) ~[?:?] at net.minecraft.server.MinecraftServer.save(MinecraftServer.java:536) ~[?:?] at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:571) ~[?:?] at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:596) ~[?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:685) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302]
La classe de l’item si jamais :
public class EmoStaff extends Item implements IItemColor { public EmoStaff(Properties properties) { super(properties); } public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) { Hand otherHand = handIn == Hand.MAIN_HAND ? Hand.OFF_HAND : Hand.MAIN_HAND; EmoSpellBook.SpellList spell = playerIn.getHeldItem(otherHand).getItem() instanceof EmoSpellBook ? ((EmoSpellBook) playerIn.getHeldItem(otherHand).getItem()).getSpell() : null; ItemStack itemStack = playerIn.getHeldItem(handIn); if (spell == null) return new ActionResult<>(ActionResultType.FAIL, itemStack); worldIn.playSound((PlayerEntity) null, playerIn.posX, playerIn.posY, playerIn.posZ, SoundEvents.ENTITY_SNOWBALL_THROW, SoundCategory.NEUTRAL, 0.5F, 0.4F / (random.nextFloat() * 0.4F + 0.8F)); if (!worldIn.isRemote) { OrbSpellEntity orbEntity = new OrbSpellEntity(spell, worldIn, playerIn); orbEntity.shoot(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0.0F, 2.5F, 1F); worldIn.addEntity(orbEntity); } playerIn.addStat(Stats.ITEM_USED.get(this)); return new ActionResult<>(ActionResultType.SUCCESS, itemStack); } @Override @OnlyIn(Dist.CLIENT) public int getColor(ItemStack stack, int tintIndex) { int white = 16777215; return tintIndex != 0 ? 10027080 : white; } }
-
Cette item ne semble pas être la source du problème, il n’utilise pas IItemColor.
Il faut que tu trouve où IItemColor est utilisé. -
@robin4002 C’est malheureusement le seul item qui implémente IItemColor, une fois supprimé le log change pour me dire qu’il ne trouve pas la méthode clientSetup(), est-ce possible que ce soit à cause du @OnlyIn(Dist.CLIENT) ?
Nouveau log :
[27sept.2021 20:47:32.989] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher running: args [--gameDir, ., --launchTarget, fmluserdevserver, --fml.mcpVersion, 20190829.143755, --fml.mcVersion, 1.14.4, --fml.forgeGroup, net.minecraftforge, --fml.forgeVersion, 28.2.0] [27sept.2021 20:47:32.993] [main/INFO] [cpw.mods.modlauncher.Launcher/MODLAUNCHER]: ModLauncher 4.1.0+62+5bfa59b starting: java version 1.8.0_302 by Temurin [27sept.2021 20:47:33.212] [main/INFO] [net.minecraftforge.fml.loading.FixSSL/CORE]: Added Lets Encrypt root certificates as additional trust [27sept.2021 20:47:33.860] [main/INFO] [cpw.mods.modlauncher.LaunchServiceHandler/MODLAUNCHER]: Launching target 'fmluserdevserver' with arguments [--gameDir, .] [27sept.2021 20:47:43.474] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, destination] and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498] [27sept.2021 20:47:43.475] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 20:47:43.476] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, location] and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 20:47:43.476] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets] and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498] [27sept.2021 20:47:43.477] [main/WARN] [net.minecraft.command.Commands/]: Ambiguity between arguments [teleport, targets, location] and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0] [27sept.2021 20:47:44.421] [Server thread/INFO] [net.minecraft.server.dedicated.DedicatedServer/]: Starting minecraft server version 1.14.4 [27sept.2021 20:47:44.698] [modloading-worker-11/INFO] [net.minecraftforge.common.ForgeMod/FORGEMOD]: Forge mod loading, version 28.2.0, for MC 1.14.4 with MCP 20190829.143755 [27sept.2021 20:47:44.698] [modloading-worker-11/INFO] [net.minecraftforge.common.MinecraftForge/FORGE]: MinecraftForge v28.2.0 Initialized [27sept.2021 20:47:44.793] [modloading-worker-9/WARN] [net.minecraft.entity.EntityType/]: No data fixer registered for entity sittable [27sept.2021 20:47:44.794] [modloading-worker-9/WARN] [net.minecraft.entity.EntityType/]: No data fixer registered for entity orb [27sept.2021 20:47:44.794] [modloading-worker-9/WARN] [net.minecraft.entity.EntityType/]: No data fixer registered for entity butterfly [27sept.2021 20:47:44.797] [modloading-worker-9/WARN] [net.minecraft.entity.EntityType/]: No data fixer registered for entity beetle [27sept.2021 20:47:44.799] [modloading-worker-9/WARN] [net.minecraft.entity.EntityType/]: No data fixer registered for entity lightning_bug [27sept.2021 20:47:44.800] [modloading-worker-9/WARN] [net.minecraft.entity.EntityType/]: No data fixer registered for entity chubby [27sept.2021 20:47:44.804] [modloading-worker-9/WARN] [net.minecraft.entity.EntityType/]: No data fixer registered for entity mouse [27sept.2021 20:47:44.805] [modloading-worker-9/WARN] [net.minecraft.entity.EntityType/]: No data fixer registered for entity orchard_spider [27sept.2021 20:47:44.841] [modloading-worker-9/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Failed to create mod instance. ModID: emomod, class fr.emotion.emomod.MainRegistry java.lang.BootstrapMethodError: java.lang.NoSuchMethodError: fr.emotion.emomod.MainRegistry.clientSetup(Lnet/minecraftforge/fml/event/lifecycle/FMLClientSetupEvent;)V at fr.emotion.emomod.MainRegistry.<init>(MainRegistry.java:131) ~[?:?] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_302] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_302] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_302] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_302] at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_302] at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:131) ~[?:28.2] at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_302] at java.util.function.Consumer.lambda$andThen$0(Consumer.java:65) ~[?:1.8.0_302] at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) ~[?:?] at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:134) ~[?:?] at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183) ~[?:1.8.0_302] at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_302] at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290) ~[?:1.8.0_302] at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) ~[?:1.8.0_302] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_302] at java.util.concurrent.ForkJoinTask.doInvoke(ForkJoinTask.java:401) ~[?:1.8.0_302] at java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:734) ~[?:1.8.0_302] at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159) ~[?:1.8.0_302] at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173) ~[?:1.8.0_302] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485) ~[?:1.8.0_302] at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:650) ~[?:1.8.0_302] at net.minecraftforge.fml.ModList.lambda$dispatchParallelEvent$11(ModList.java:134) ~[?:?] at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1386) [?:1.8.0_302] at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) [?:1.8.0_302] at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) [?:1.8.0_302] at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) [?:1.8.0_302] at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) [?:1.8.0_302] Caused by: java.lang.NoSuchMethodError: fr.emotion.emomod.MainRegistry.clientSetup(Lnet/minecraftforge/fml/event/lifecycle/FMLClientSetupEvent;)V at java.lang.invoke.MethodHandleNatives.resolve(Native Method) ~[?:1.8.0_302] at java.lang.invoke.MemberName$Factory.resolve(MemberName.java:975) ~[?:1.8.0_302] at java.lang.invoke.MemberName$Factory.resolveOrFail(MemberName.java:1000) ~[?:1.8.0_302] at java.lang.invoke.MethodHandles$Lookup.resolveOrFail(MethodHandles.java:1394) ~[?:1.8.0_302] at java.lang.invoke.MethodHandles$Lookup.linkMethodHandleConstant(MethodHandles.java:1750) ~[?:1.8.0_302] at java.lang.invoke.MethodHandleNatives.linkMethodHandleConstant(MethodHandleNatives.java:477) ~[?:1.8.0_302] ... 30 more [27sept.2021 20:47:44.848] [Server thread/FATAL] [net.minecraftforge.fml.ModLoader/LOADING]: Failed to complete lifecycle event CONSTRUCT, 1 errors found [27sept.2021 20:47:44.848] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Encountered an unexpected exception net.minecraftforge.fml.LoadingFailedException: Loading errors encountered: [ Emotion's Mod (emomod) has failed to load correctly §7java.lang.NoSuchMethodError: fr.emotion.emomod.MainRegistry.clientSetup(Lnet/minecraftforge/fml/event/lifecycle/FMLClientSetupEvent;)V ] at net.minecraftforge.fml.ModLoader.dispatchAndHandleError(ModLoader.java:201) ~[?:?] at net.minecraftforge.fml.ModLoader.gatherAndInitializeMods(ModLoader.java:183) ~[?:?] at net.minecraftforge.fml.server.ServerModLoader.begin(ServerModLoader.java:45) ~[?:?] at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:124) ~[?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:622) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302] [27sept.2021 20:47:44.856] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: This crash report has been saved to: E:\Users\micka_000\Documents\Programmation\Minecraft\Emotion's Mod\1.14.3\Emomod\run\.\crash-reports\crash-2021-09-27_20.47.44-server.txt [27sept.2021 20:47:44.870] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Stopping server [27sept.2021 20:47:44.870] [Server thread/INFO] [net.minecraft.server.MinecraftServer/]: Saving worlds [27sept.2021 20:47:44.870] [Server thread/ERROR] [net.minecraft.server.MinecraftServer/]: Exception stopping the server java.lang.RuntimeException: The server has failed to initialize correctly due to mod loading errors. Examine the crash report for more details. at net.minecraftforge.common.DimensionManager.getWorld(DimensionManager.java:182) ~[?:?] at net.minecraft.server.MinecraftServer.getWorld(MinecraftServer.java:1027) ~[?:?] at net.minecraft.server.MinecraftServer.save(MinecraftServer.java:536) ~[?:?] at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:571) ~[?:?] at net.minecraft.server.dedicated.DedicatedServer.stopServer(DedicatedServer.java:596) ~[?:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:685) [?:?] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_302]
-
Heu oui maintenant il ne trouve plus clientSetup.
Il faudrait quand même le garder alors et déplacer les appels qui se trouve dedans dans une autre classe en client uniquement. -
Bon, après avoir déplacé tous dans la méthode init de mon ClientProxy qui est appelé avec la fonction :
DistExecutor.runForDist(() -> () -> new ClientProxy(), () -> () -> new ServerProxy());
Et après avoir fais le tour de mes classes pour ajouter la balise @OnlyIn(Dist.CLIENT) quand c’était nécessaire, ça semble fonctionner, merci beaucoup de l’aide @robin4002; À l’avenir je penserais à cette balise et à lancer en serveur de temps en temps.