Résolu Crash Serveur
-
Bonjour,
J’ai créé un code pour un gui pour test, puis quand j’ai mis mon mod dans le dossier mods de mon serveur, le serveur crash.–-- Minecraft Crash Report ---- // I let you down. Sorry :( (troll ?) Time: 24/07/15 19:18 Description: Exception in server tick loop net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/gui/GuiScreen at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:163) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:532) at net.minecraftforge.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:88) at net.minecraftforge.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:355) at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:117) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:438) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/gui/GuiScreen at tarael.Common.TutorialBlocks.init(TutorialBlocks.java:20) at tarael.Common.ModTarael.preInit(ModTarael.java:46) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:537) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:529) ... 5 more Caused by: java.lang.ClassNotFoundException: net.minecraft.client.gui.GuiScreen at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 34 more Caused by: net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerException: Exception in class transformer net.minecraftforge.fml.common.asm.transformers.SideTransformer@4f6f416f from coremod FMLCorePlugin at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:234) at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176) ... 36 more Caused by: java.lang.RuntimeException: Attempted to load class bxf for invalid side SERVER at net.minecraftforge.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:49) at net.minecraftforge.fml.common.asm.ASMTransformerWrapper$TransformerWrapper.transform(ASMTransformerWrapper.java:230) ... 38 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_25, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 369362152 bytes (352 MB) / 479199232 bytes (457 MB) up to 954728448 bytes (910 MB) JVM Flags: 1 total; -Xmx1024M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.10 FML v8.0.99.99 Minecraft Forge 11.14.3.1446 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{8.0.99.99} [Forge Mod Loader] (forgeserver.jar) Unloaded->Constructed->Pre-initialized Forge{11.14.3.1446} [Minecraft Forge] (forgeserver.jar) Unloaded->Constructed->Pre-initialized tm{Drakaelia_0.01_1} [Mod Palexor] (tm-Drakaelia_0.01_1.jar) Unloaded->Constructed->Errored Loaded coremods (and transformers): Profiler Position: N/A (disabled) Is Modded: Definitely; Server brand changed to 'fml,forge' Type: Dedicated Server (map_server.txt)
J’ai regardé le document du crash mais je n’ai pas très bien compris la raison du crash.
Au cas ou voici les classes, qui d’après ce que j’ai compris, cause le crash:
TutorialBlocks:
package tarael.Common; import tarael.Common.blocks.Blocknigga; import tarael.Common.blocks.Blocktablefr; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class TutorialBlocks { public static Block tablefr, nigga; public static void init() { tablefr = new Blocktablefr(Material.wood).setUnlocalizedName("tablefr").setCreativeTab(CreativeTabs.tabDecorations); nigga = new Blocknigga(Material.rock).setUnlocalizedName("nigga").setCreativeTab(CreativeTabs.tabDecorations); } public static void register() { GameRegistry.registerBlock(tablefr, tablefr.getUnlocalizedName().substring(5)); GameRegistry.registerBlock(nigga, nigga.getUnlocalizedName().substring(5)); } public static void registerRenders() { registerRender(tablefr); registerRender(nigga); } public static void registerRender(Block block) { Item item = Item.getItemFromBlock(block); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation("tm:" + item.getUnlocalizedName().substring(5), "inventory")); } }
ModTarael:
package tarael.Common; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.Mod.Instance; import net.minecraftforge.fml.common.SidedProxy; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.network.IGuiHandler; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; import net.minecraftforge.fml.relauncher.Side; import tarael.Client.CommonProxy; import tarael.system.PacketPipeline; @Mod(modid = "tm", name = "Mod Palexor", version = "Drakaelia_0.01_1") public class ModTarael { public static ToolMaterial lance1 = EnumHelper.addToolMaterial("lance1", 3, 999999, 1.0F, 9.0F, 10); public static ToolMaterial lance2 = EnumHelper.addToolMaterial("lance2", 3, 999999, 1.0F, 6.0F, 10); public static ToolMaterial dkbtf = EnumHelper.addToolMaterial("dkbtf", 3, 999999, 1.0F, 8.0F, 10); public static ToolMaterial hachede = EnumHelper.addToolMaterial("hachede", 3, 999999, 1.0F, 7.0F, 10); public static ToolMaterial dblade = EnumHelper.addToolMaterial("dblade", 3, 999999, 1.0F, 8.0F, 10); public static ArmorMaterial armorg1 = EnumHelper.addArmorMaterial("armorg1", "casque_guerrier", 1999999, new int[] {5, 7, 5, 3}, 10); public static SimpleNetworkWrapper network; public static final PacketPipeline packetPipeline = new PacketPipeline(); @Instance("tm") public static ModTarael instance; @SidedProxy(clientSide = "tarael.Client.ClientProxy", serverSide = "tarael.Client.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { TutorialBlocks.init(); TutorialBlocks.register(); TutorialItems.init(); TutorialItems.register(); TutorialItems.name(); TaraelArmors.init(); TaraelArmors.name(); TaraelArmors.register(); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRenders(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
-
Salut,
Envoies-nous la classe Blocktablefr -
Voila :
package tarael.Common.blocks; import tarael.Common.ModTarael; import tarael.gui.GuiAtelierSwordT1; import net.minecraft.block.Block; import net.minecraft.block.BlockAnvil; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; public class Blocktablefr extends Block { public Blocktablefr(Material materialIn) { super(materialIn); } @Override public boolean onBlockActivated(World parWorld, BlockPos parBlockPos, IBlockState parIBlockState, EntityPlayer parPlayer, EnumFacing parSide, float hitX, float hitY, float hitZ) { if (!parWorld.isRemote) { Minecraft.getMinecraft().displayGuiScreen( new GuiAtelierSwordT1(parPlayer)); } return true; } @Override public boolean isOpaqueCube() { return false; } }
-
Ajoute @SideOnly(Side.CLIENT) au dessus de la fonction onBlockActivated
-
@‘robin4002’:
Ajoute @SideOnly(Side.CLIENT) au dessus de la fonction onBlockActivated
Donc ça veut dire que je ne vais plus pouvoir l’ouvrir côté serveur ?
-
Si. Il faut juste que tu retire le if (!parWorld.isRemote)
-
Bon ben merci