MFF

    Minecraft Forge France
    • Récent
    • Mots-clés
    • Populaire
    • Utilisateurs
    • Groupes
    • Forge Events
      • Automatique
      • Foncé
      • Clair
    • S'inscrire
    • Se connecter

    Chargement biome

    Planifier Épinglé Verrouillé Déplacé Sans suite
    1.7.2
    37 Messages 4 Publieurs 6.8k Vues 1 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • darkvince37D Hors-ligne
      darkvince37
      dernière édition par

      @‘BrokenSwing’:

      Bah ça risque de ne pas marcher, une variable peut pas être égale à une classe et perso (en 1.9) je n’ai pas accès à la variable gui donc je doit faire plutôt un truc comme ça

      
      public void onGuiScreen(GuiScreenEvent.DrawScreenEvent.Pre e) {
      if(e.getGui() instanceof GuiDownloadTerrain) {
      e.setCanceled(true);
      Minecraft.getMinecraft().displayGuiScreen(new GuiScreenDemo()); //remplace GuiScreenDemo par ton propre GuiScreen
      }
      
      

      Dans ton GuiScreen il va peut-être falloir que tu envoie des packets car Minecraft le fait lui, regarde la classe GuiDownloadTerrain il envoie des packets KeepAlive

      En gros je fait comme si je modifier mon menu in game

      1 réponse Dernière réponse Répondre Citer 0
      • BrokenSwingB Hors-ligne
        BrokenSwing Moddeurs confirmés Rédacteurs
        dernière édition par

        Presque, en gros tu cancel l’affichage du GuiScreen GuiDownloadTerrain et tu le remplace par le tien

        1 réponse Dernière réponse Répondre Citer 0
        • darkvince37D Hors-ligne
          darkvince37
          dernière édition par

          @‘BrokenSwing’:

          Presque, en gros tu cancel l’affichage du GuiScreen GuiDownloadTerrain et tu le remplace par le tien

          Voilà se que sa donne a la fin

          package fr.darkvince.facrpg.menu;
          
          import com.mojang.realmsclient.gui.ChatFormatting;
          import cpw.mods.fml.common.eventhandler.SubscribeEvent;
          import net.minecraft.client.Minecraft;
          import net.minecraft.client.gui.GuiDownloadTerrain;
          import net.minecraft.client.gui.GuiScreen;
          import net.minecraft.client.gui.ScaledResolution;
          import net.minecraft.client.renderer.Tessellator;
          import net.minecraft.client.renderer.texture.TextureManager;
          import net.minecraft.util.ResourceLocation;
          import net.minecraftforge.client.event.GuiScreenEvent;
          import net.minecraftforge.client.event.RenderGameOverlayEvent;
          import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
          import org.lwjgl.opengl.GL11;
          import scala.util.Random;
          
          public class ClientEventHandler  extends GuiScreen
          {
          
           public void onGuiScreen(GuiScreenEvent.DrawScreenEvent.Pre e) {
           if(e.gui instanceof GuiDownloadTerrain) {
           e.setCanceled(true);
           Minecraft.getMinecraft().displayGuiScreen(new GuiChargement(null));
           }
           }
          }
          
          
          package fr.darkvince.facrpg.menu;
          
          import org.lwjgl.opengl.GL11;
          
          import com.mojang.realmsclient.gui.ChatFormatting;
          
          import net.minecraft.client.Minecraft;
          import net.minecraft.client.gui.GuiScreen;
          import net.minecraft.client.gui.ScaledResolution;
          import net.minecraft.client.network.NetHandlerPlayClient;
          import net.minecraft.client.renderer.Tessellator;
          import net.minecraft.client.resources.I18n;
          import net.minecraft.network.play.client.C00PacketKeepAlive;
          import net.minecraft.util.ResourceLocation;
          import scala.util.Random;
          
          public class GuiChargement extends GuiScreen {
          
           public ResourceLocation loadingscreen = new ResourceLocation("facrpg", "textures/gui/LoadingScreen.png");
           public String[] quotes = { "Test 1", "Test 12"};
           public int selector = 280;
           private NetHandlerPlayClient field_146594_a;
           public boolean doneDraw = false;
             public GuiChargement(NetHandlerPlayClient p_i45023_1_)
             {
              this.field_146594_a = p_i45023_1_;
             }
          
             public void drawTexturedRect(int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight)
           {
             float f = 1.0F / textureWidth;
             float f1 = 1.0F / textureHeight;
             Tessellator tessellator = Tessellator.instance;
             tessellator.startDrawingQuads();
             tessellator.addVertexWithUV(x, y + height, 0.0D, u * f, (v + height) * f1);
             tessellator.addVertexWithUV(x + width, y + height, 0.0D, (u + width) * f, (v + height) * f1);
             tessellator.addVertexWithUV(x + width, y, 0.0D, (u + width) * f, v * f1);
             tessellator.addVertexWithUV(x, y, 0.0D, u * f, v * f1);
             tessellator.draw();
           }
          
             /**
              * Draws the screen and all the components in it.
              */
             public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
             {
                 ScaledResolution res = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
                 int posX = res.getScaledWidth();
                 int posY = res.getScaledHeight();
                 Minecraft.getMinecraft().renderEngine.bindTexture(this.loadingscreen);
                 drawTexturedRect(0, 0, 0, 0, posX, posY, posX, posY);
                 if (!this.doneDraw)
                 {
                   this.selector = new Random().nextInt(this.quotes.length);
                   this.doneDraw = true;
                 }
                 GL11.glPushMatrix();
                 GL11.glScalef(0.5F, 0.5F, 0.5F);
                 drawCenteredString(Minecraft.getMinecraft().fontRenderer, ChatFormatting.WHITE + this.quotes[this.selector], posX, posY, 0);
                 GL11.glPopMatrix();
                 drawCenteredString(Minecraft.getMinecraft().fontRenderer, ChatFormatting.DARK_RED + "Chargment…", posX / 2, posY / 2 + 90, 0);
             }
          
             /**
              * Returns true if this GUI should pause the game when it is displayed in single-player
              */
             public boolean doesGuiPauseGame()
             {
                 return false;
             }
          }
          

          Mais sa marche pas la class original du GuiDownloadTerrain

          package net.minecraft.client.gui;
          
          import cpw.mods.fml.relauncher.Side;
          import cpw.mods.fml.relauncher.SideOnly;
          import net.minecraft.client.network.NetHandlerPlayClient;
          import net.minecraft.client.resources.I18n;
          import net.minecraft.network.play.client.C00PacketKeepAlive;
          
          @SideOnly(Side.CLIENT)
          public class GuiDownloadTerrain extends GuiScreen
          {
              private NetHandlerPlayClient field_146594_a;
              private int field_146593_f;
              private static final String __OBFID = "CL_00000708";
          
              public GuiDownloadTerrain(NetHandlerPlayClient p_i45023_1_)
              {
                  this.field_146594_a = p_i45023_1_;
              }
          
              /**
               * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
               */
              protected void keyTyped(char p_73869_1_, int p_73869_2_) {}
          
              /**
               * Adds the buttons (and other controls) to the screen in question.
               */
              public void initGui()
              {
                  this.buttonList.clear();
              }
          
              /**
               * Called from the main game loop to update the screen.
               */
              public void updateScreen()
              {
                  ++this.field_146593_f;
          
                  if (this.field_146593_f % 20 == 0)
                  {
                      this.field_146594_a.addToSendQueue(new C00PacketKeepAlive());
                  }
          
                  if (this.field_146594_a != null)
                  {
                      this.field_146594_a.onNetworkTick();
                  }
              }
          
              /**
               * Draws the screen and all the components in it.
               */
              public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
              {
                  this.drawBackground(0);
                  this.drawCenteredString(this.fontRendererObj, I18n.format("multiplayer.downloadingTerrain", new Object[0]), this.width / 2, this.height / 2 - 50, 16777215);
                  super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
              }
          
              /**
               * Returns true if this GUI should pause the game when it is displayed in single-player
               */
              public boolean doesGuiPauseGame()
              {
                  return false;
              }
          }
          
          1 réponse Dernière réponse Répondre Citer 0
          • BrokenSwingB Hors-ligne
            BrokenSwing Moddeurs confirmés Rédacteurs
            dernière édition par

            Le @SubscriveEvent …
            L’extends GuiScreen tu peux l’enlever
            Le null en paramètre tu va sûrement crash
            EDIT : Ah bah non tu l’utilise même pas, tu va pas crash

            1 réponse Dernière réponse Répondre Citer 0
            • darkvince37D Hors-ligne
              darkvince37
              dernière édition par

              @‘BrokenSwing’:

              Le @SubscriveEvent …
              L’extends GuiScreen tu peux l’enlever
              Le null en paramètre tu va sûrement crash
              EDIT : Ah bah non tu l’utilise même pas, tu va pas crash

              Merci sa marche, je voudrai savoir si je peut aussi le faire quand je créer un monde quand je me tp dedans sa fait l’animation. Et si je peut augmenté le temps de chargement

              1 réponse Dernière réponse Répondre Citer 0
              • BrokenSwingB Hors-ligne
                BrokenSwing Moddeurs confirmés Rédacteurs
                dernière édition par

                Quand tu créer un monde -> Oui, de la même manière
                Quand tu te tp dedans ça fait l’animation ? Pas compris
                Augmenter le temps de chargement -> Pourquoi ? Ok tu veux qu’on puisse lire ce qu’il y a marqué sur ton image mais tes joueurs vont pas apprécier mais je sais pas fat voir tu dois sûrement pouvoir

                1 réponse Dernière réponse Répondre Citer 0
                • darkvince37D Hors-ligne
                  darkvince37
                  dernière édition par

                  @‘BrokenSwing’:

                  Quand tu créer un monde -> Oui, de la même manière
                  Quand tu te tp dedans ça fait l’animation ? Pas compris
                  Augmenter le temps de chargement -> Pourquoi ? Ok tu veux qu’on puisse lire ce qu’il y a marqué sur ton image mais tes joueurs vont pas apprécier mais je sais pas fat voir tu dois sûrement pouvoir

                  Quand tu te tp dedans ça fait l’animation ? Pas compris. Mettre l’image

                  Car le chargement dur meme pas 1 secondes je voudrai le faire passer a 5secondes pour voir mieu l’image

                  Quand tu créer un monde -> Oui, de la même manière. Je vais essayé de trouver le Gui alors

                  1 réponse Dernière réponse Répondre Citer 0
                  • BrokenSwingB Hors-ligne
                    BrokenSwing Moddeurs confirmés Rédacteurs
                    dernière édition par

                    Quant tu te tp c’est instantané donc bon … Au mieux tu a le chargement des chunks si le tp est vraiment lointain

                    1 réponse Dernière réponse Répondre Citer 0
                    • darkvince37D Hors-ligne
                      darkvince37
                      dernière édition par

                      @‘BrokenSwing’:

                      Quant tu te tp c’est instantané donc bon … Au mieux tu a le chargement des chunks si le tp est vraiment lointain

                      Mauvais nouvelle il crash sur le serveur

                      –-- Minecraft Crash Report ----
                      // I blame Dinnerbone.
                      
                      Time: 10/06/16 18:33
                      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:162)
                      at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691)
                      at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:97)
                      at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:318)
                      at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:259)
                      at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:607)
                      at java.lang.Thread.run(Thread.java:745)
                      Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/gui/GuiScreen
                      at fr.darkvince.facrpg.Main.Init(Main.java:465)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                      at java.lang.reflect.Method.invoke(Method.java:497)
                      at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
                      at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                      at java.lang.reflect.Method.invoke(Method.java:497)
                      at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
                      at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)
                      at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
                      at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
                      at com.google.common.eventbus.EventBus.post(EventBus.java:267)
                      at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
                      at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                      at java.lang.reflect.Method.invoke(Method.java:497)
                      at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
                      at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)
                      at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
                      at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
                      at com.google.common.eventbus.EventBus.post(EventBus.java:267)
                      at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
                      at cpw.mods.fml.common.Loader.initializeMods(Loader.java:690)
                      ... 5 more
                      Caused by: java.lang.ClassNotFoundException: net.minecraft.client.gui.GuiScreen
                      at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:188)
                      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
                      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
                      ... 32 more
                      Caused by: java.lang.RuntimeException: Attempted to load class bcd for invalid side SERVER
                      at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:51)
                      at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:276)
                      at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:174)
                      ... 34 more
                      
                      A detailed walkthrough of the error, its code path and all known details is as follows:
                      ---------------------------------------------------------------------------------------
                      
                      -- System Details --
                      Details:
                      Minecraft Version: 1.7.2
                      Operating System: Linux (amd64) version 3.5.0-47-generic
                      Java Version: 1.8.0_60, Oracle Corporation
                      Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                      Memory: 143758792 bytes (137 MB) / 259522560 bytes (247 MB) up to 10416029696 bytes (9933 MB)
                      JVM Flags: 23 total; -Xmx10000M -Xms256M -XX:MaxPermSize=256m -XX:PermSize=128m -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+UseNUMA -XX:+CMSParallelRemarkEnabled -XX:MaxGCPauseMillis=50 -XX:+UseAdaptiveGCBoundary -XX:-UseGCOverheadLimit -XX:+UseBiasedLocking -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=15 -XX:UseSSE=3 -XX:+UseLargePages -XX:+UseFastAccessorMethods -XX:+UseStringCache -XX:+UseCompressedOops -XX:+OptimizeStringConcat -XX:+AggressiveOpts
                      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.03 FML v7.2.217.1147 Minecraft Forge 10.12.2.1147 9 mods loaded, 9 mods active
                      mcp{9.03} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized
                      FML{7.2.217.1147} [Forge Mod Loader] (cauldron-1.7.2-1.1147.04.98-server.jar) Unloaded->Constructed->Pre-initialized->Initialized
                      Forge{10.12.2.1147} [Minecraft Forge] (cauldron-1.7.2-1.1147.04.98-server.jar) Unloaded->Constructed->Pre-initialized->Initialized
                      asielib{0.2.7} [asielib] (AsieLib-1.7.2.zip) Unloaded->Constructed->Pre-initialized->Initialized
                      customnpcs{1.7.2-2} [CustomNpcs] (CustomNPCs_1.7.2.jar) Unloaded->Constructed->Pre-initialized->Initialized
                      facrpg{1.0} [facrpg] (facrpg-1.0.jar) Unloaded->Constructed->Pre-initialized->Errored
                      ModCustomMenu{1.0} [ModCustomMenu] (facrpg-1.0.jar) Unloaded->Constructed->Pre-initialized->Initialized
                      autoutils{1.0.1} [Autoutils] (Statues-Mod-1.7.2.zip) Unloaded->Constructed->Pre-initialized->Initialized
                      statues{2.1.1} [Statues] (Statues-Mod-1.7.2.zip) Unloaded->Constructed->Pre-initialized->Initialized
                      Profiler Position: N/A (disabled)
                      Player Count: 0 / 100; []
                      Is Modded: Definitely; Server brand changed to 'cauldron,craftbukkit,mcpc,fml,forge'
                      Type: Dedicated Server (map_server.txt)
                      
                      1 réponse Dernière réponse Répondre Citer 0
                      • BrokenSwingB Hors-ligne
                        BrokenSwing Moddeurs confirmés Rédacteurs
                        dernière édition par

                        Tu as deux solutions :
                        Soit tu fait 2 event handler avec 1 pour le client et l’autre pour les deux
                        Soit tu met un condition pour vérifier si tu es sur le client et dans ce cas affiche le GUI

                        Pour t’expliquer ce qu’il se passe, grossomodo le serveur essai d’afficher un GUI mais les GUI c’est côté client dans il crash

                        1 réponse Dernière réponse Répondre Citer 0
                        • darkvince37D Hors-ligne
                          darkvince37
                          dernière édition par

                          @‘BrokenSwing’:

                          Tu as deux solutions :
                          Soit tu fait 2 event handler avec 1 pour le client et l’autre pour les deux
                          Soit tu met un condition pour vérifier si tu es sur le client et dans ce cas affiche le GUI

                          Pour t’expliquer ce qu’il se passe, grossomodo le serveur essai d’afficher un GUI mais les GUI c’est côté client dans il crash

                          Donc je le mais dans client proxy cette ligne

                          Envoyé de mon SM-G928F en utilisant Tapatalk

                          1 réponse Dernière réponse Répondre Citer 0
                          • BrokenSwingB Hors-ligne
                            BrokenSwing Moddeurs confirmés Rédacteurs
                            dernière édition par

                            Quelle ligne ?

                            1 réponse Dernière réponse Répondre Citer 0
                            • 1
                            • 2
                            • 2 / 2
                            • Premier message
                              Dernier message
                            Design by Woryk
                            ContactMentions Légales

                            MINECRAFT FORGE FRANCE © 2024

                            Powered by NodeBB