• Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Solved Un crash uniquement du coté serveur

    1.7.x
    1.7.10
    3
    9
    985
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yveslefou last edited by

      Bonjour à tout le monde. J’ais voulue réaliser un petit Gui personnalisé qui ne contient pas de slot mais uniquement une image et des labels. Il marche trés bien du coté client mais fais crash lors du chargement coté serveur.

      @SideOnly(Side.CLIENT)
      
      public class GuiStat extends GuiScreen
      {
      int guiWidth= 250;
      int guiHeight= 250;
      public void drawScreen(int x ,int y,float ticks ){
      int guix =(width - guiWidth) /2 ;
      int guiy =(height - guiHeight) /2;
      GL11.glColor4f(1,1,1,1);
      drawDefaultBackground();
      this.mc.renderEngine.bindTexture(new ResourceLocation("extaziliamod", "textures/gui/Gui1.png"));
      drawTexturedModalRect(guix, guiy, 0, 0, guiWidth, guiHeight);
      fontRendererObj.drawString("A venir ", guix +120, guiy +85, 0x404040 );
      fontRendererObj.drawString("A venir ", guix +120, guiy +115, 0x404040 );
      fontRendererObj.drawString("A venir ", guix +120, guiy +145, 0x404040 );
      super.drawScreen(x, y, ticks);
      
      }
      }
      
      

      Le soucie vient certainement du faite que le gui mette le jeux en pause du coté client mais j’ais eu beau chercher sur google mais je n’ais pas trouvé pour éviter cela. Si quelqu’un voudrait bien me donner une piste pour résoudre ce soucie.

      1 Reply Last reply Reply Quote 0
      • robin4002
        robin4002 Moddeurs confirmés Rédacteurs Administrateurs last edited by

        Salut,
        Rien à voir avec la pause.
        Envoies le rapport de crash + la classe où tu ouvres le gui.

        1 Reply Last reply Reply Quote 0
        • Y
          yveslefou last edited by

          La classe qui me permet d’ouvrir le gui :

          public class Guide1 extends Item 
          {
          
          public Guide1()
          {
             this.setCreativeTab(CreativeTabs.tabMaterials);
             this.maxStackSize=1;
          }
          
          public ItemStack onItemRightClick(ItemStack Stack,World world,EntityPlayer player)
          {
          if (!world.isRemote){ 
          
          Minecraft.getMinecraft().displayGuiScreen(new GuiStat());
          }
          return super.onItemRightClick(Stack, world, player);
          }
          }
          
          1 Reply Last reply Reply Quote 0
          • Deleted
            Deleted last edited by

            Retire le ! devant world.
            isRemote signifie “est côté client”. Du coup tu pourras aussi retirer l’annotation SideOnly dans ta classe Gui

            1 Reply Last reply Reply Quote 0
            • Y
              yveslefou last edited by

              Cela n’empéche pas le crash coté serveur néanmoins merci pour ses informations le crash est :

              –-- Minecraft Crash Report ----
              // I feel sad now :(
              
              Time: 06/03/16 14:15
              Description: Exception in server tick loop
              
              cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/gui/GuiScreen
              at cpw.mods.fml.common.LoadController.transition(LoadController.java:163)
              at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:559)
              at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:88)
              at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:314)
              at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:120)
              at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:445)
              at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)
              Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/gui/GuiScreen
              at fr.extazilia.extaziliamod.common.Main.preInit(Main.java:108)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
              at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
              at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
              at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
              at com.google.common.eventbus.EventBus.post(EventBus.java:275)
              at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
              at cpw.mods.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 cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
              at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556)
              ... 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)
              ... 33 more
              Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/gui/GuiScreen for invalid side SERVER
              at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:50)
              at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279)
              at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176)
              ... 35 more
              
              A detailed walkthrough of the error, its code path and all known details is as follows:
              ---------------------------------------------------------------------------------------
              
              -- System Details --
              Details:
              Minecraft Version: 1.7.10
              Operating System: Windows 10 (amd64) version 10.0
              Java Version: 1.8.0_73, Oracle Corporation
              Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
              Memory: 947167680 bytes (903 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
              JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
              AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
              IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
              FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 4 mods loaded, 4 mods active
              States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
              UCH mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
              UCH FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar)
              UCH Forge{10.13.4.1614} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar)
              UCE extaziliamod{1.1} [Extazilia Mod] (bin)
              Profiler Position: N/A (disabled)
              Is Modded: Definitely; Server brand changed to 'fml,forge'
              Type: Dedicated Server (map_server.txt)
              
              1 Reply Last reply Reply Quote 0
              • robin4002
                robin4002 Moddeurs confirmés Rédacteurs Administrateurs last edited by

                Il faudrait mettre un @SideOnly au dessus onItemRightClick

                1 Reply Last reply Reply Quote 0
                • Y
                  yveslefou last edited by

                  Merci beaucoup mon probléme est résolue grâce à vous robin

                  1 Reply Last reply Reply Quote 0
                  • Deleted
                    Deleted last edited by

                    C’était pourtant pas compliqué de retirer un ! après le if

                    1 Reply Last reply Reply Quote 0
                    • Y
                      yveslefou last edited by

                      Le if n’était pas seul soucis apparement car j’ais testé en le retirant et cela crashé encore mais en fesais partie alors je te remercie aussi

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      • First post
                        Last post
                      Design by Woryk
                      Contact / Mentions Légales

                      MINECRAFT FORGE FRANCE © 2018

                      Powered by NodeBB