MFF

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

    Interface minecraft

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.10
    47 Messages 6 Publieurs 6.2k 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.
    • Z Hors-ligne
      Zokyt
      dernière édition par

      import cpw.mods.fml.common.eventhandler.SubscribeEvent;
      import net.minecraft.client.gui.GuiMainMenu;
      import net.minecraftforge.client.event.GuiOpenEvent;
      
      public class GuiMainMenuEventHandler {
      
          @SubscribeEvent
          public static void onGuiOpens(GuiOpenEvent event) {
              if(event.gui instanceof GuiMainMenu) {
                  event.gui = new GuiCustomMainMenu();
              }
          }
      
      }
      
      package com.mod.exonia.gui;
      
      import cpw.mods.fml.client.FMLClientHandler;
      import cpw.mods.fml.common.eventhandler.SubscribeEvent;
      import com.mod.exonia.gui.GuiCustomMainMenu;
      import net.minecraft.client.gui.GuiMainMenu;
      import net.minecraftforge.client.event.GuiOpenEvent;
      
      public class GuiMainMenuEvent 
      {
      @SubscribeEvent
      public void onGuiInitPost(GuiOpenEvent event)
      {
      if(event.gui.getClass().equals(GuiMainMenu.class))
      {
      FMLClientHandler.instance().getClient().displayGuiScreen(new GuiCustomMainMenu());
      }
      }
      }
      

      Bh ces bon mais ces tjr pareil


      Ducoup je fait comment ?

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

        1 seule classe d’event, or là tu en as deux. Vire ta classe GuiMainMenuEvent.

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

          Ces bon j’ai supprimet la classe mais mon interface ne change toujours pas je redonne tout mes code :

          package com.mod.exonia.gui;
          
          import cpw.mods.fml.common.eventhandler.SubscribeEvent;
          import net.minecraft.client.gui.GuiMainMenu;
          import net.minecraftforge.client.event.GuiOpenEvent;
          
          public class GuiMainMenuEventHandler {
          
              @SubscribeEvent
              public static void onGuiOpens(GuiOpenEvent event) {
                  if(event.gui instanceof GuiMainMenu) {
                      event.gui = new GuiCustomMainMenu();
                  }
              }
          
          }
          
          package com.mod.exonia.proxy;
          
          import com.mod.exonia.dynamite.EntityDynamite;
          import com.mod.exonia.gui.GuiCustomMainMenu;
          import com.mod.exonia.gui.GuiMainMenuEventHandler;
          import com.mod.exonia.init.ItemMod;
          
          import cpw.mods.fml.client.FMLClientHandler;
          import cpw.mods.fml.client.registry.RenderingRegistry;
          import cpw.mods.fml.common.FMLCommonHandler;
          import cpw.mods.fml.common.eventhandler.SubscribeEvent;
          import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
          import cpw.mods.fml.relauncher.Side;
          import cpw.mods.fml.relauncher.SideOnly;
          import net.minecraft.client.Minecraft;
          import net.minecraft.client.gui.GuiIngameMenu;
          import net.minecraft.client.gui.GuiMainMenu;
          import net.minecraft.client.renderer.entity.RenderSnowball;
          import net.minecraft.client.settings.KeyBinding;
          import net.minecraftforge.client.event.GuiOpenEvent;
          import net.minecraftforge.common.MinecraftForge;
          
          public class ClientProxy extends CommonProxy
          {
          
              public static KeyBinding keyBinding;
          
              @Override
              public void registerRenders()
              {
                  RenderingRegistry.registerEntityRenderingHandler(EntityDynamite.class, new RenderSnowball(ItemMod.dynamite));
          
              }
          
              public ClientProxy()
              {
                  FMLCommonHandler.instance().bus().register(new GuiMainMenuEventHandler());
                  MinecraftForge.EVENT_BUS.register(GuiMainMenuEventHandler.class);
              }
          
              @SubscribeEvent
              public void onEvent(KeyInputEvent event)
              {
          
              }
          
              private void keyPressed()
              {
          
              }
          
          }
          
           package com.mod.exonia.gui;
          
          import java.io.BufferedReader;
          import java.io.IOException;
          import java.io.InputStreamReader;
          import java.net.URI;
          import java.util.ArrayList;
          import java.util.Calendar;
          import java.util.Date;
          import java.util.Random;
          
          import org.apache.commons.io.Charsets;
          import org.apache.logging.log4j.LogManager;
          import org.apache.logging.log4j.Logger;
          import org.lwjgl.opengl.GL11;
          import org.lwjgl.opengl.GLContext;
          
          import cpw.mods.fml.client.FMLClientHandler;
          import cpw.mods.fml.client.GuiModList;
          import cpw.mods.fml.relauncher.Side;
          import cpw.mods.fml.relauncher.SideOnly;
          import net.minecraft.client.Minecraft;
          import net.minecraft.client.gui.GuiButton;
          import net.minecraft.client.gui.GuiConfirmOpenLink;
          import net.minecraft.client.gui.GuiLanguage;
          import net.minecraft.client.gui.GuiMultiplayer;
          import net.minecraft.client.gui.GuiOptions;
          import net.minecraft.client.gui.GuiScreen;
          import net.minecraft.client.gui.GuiSelectWorld;
          import net.minecraft.client.gui.GuiYesNo;
          import net.minecraft.client.gui.GuiYesNoCallback;
          import net.minecraft.client.renderer.OpenGlHelper;
          import net.minecraft.client.renderer.Tessellator;
          import net.minecraft.client.renderer.texture.DynamicTexture;
          import net.minecraft.client.resources.I18n;
          import net.minecraft.util.EnumChatFormatting;
          import net.minecraft.util.MathHelper;
          import net.minecraft.util.ResourceLocation;
          import net.minecraft.world.demo.DemoWorldServer;
          import net.minecraft.world.storage.ISaveFormat;
          import net.minecraft.world.storage.WorldInfo;
          
          @SideOnly(Side.CLIENT)
          public class GuiCustomMainMenu extends GuiScreen implements GuiYesNoCallback
          {
             private static final Logger logger = LogManager.getLogger();
             /** The RNG used by the Main Menu Screen. */
             private static final Random rand = new Random();
             /** Counts the number of screen updates. */
             private float updateCounter;
             /** The splash message. */
             private String splashText;
             private GuiButton buttonResetDemo;
             /** Timer used to rotate the panorama, increases every tick. */
             private int panoramaTimer;
             /**
              * Texture allocated for the current viewport of the main menu's panorama background.
              */
             private DynamicTexture viewportTexture;
             private final Object field_104025_t = new Object();
             private String field_92025_p;
             private String field_146972_A;
             private String field_104024_v;
             private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt");
             private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png");
             /** An array of all the paths to the panorama pictures. */
             private final ResourceLocation backGround = new ResourceLocation("moreitemfr", "textures/gui/menu.png");
             public static final String field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information.";
             private int field_92024_r;
             private int field_92023_s;
             private int field_92022_t;
             private int field_92021_u;
             private int field_92020_v;
             private int field_92019_w;
             private ResourceLocation field_110351_G;
             private static final String __OBFID = "CL_00001154";
          
          public GuiCustomMainMenu()
             {
                 this.field_146972_A = field_96138_a;
                 this.splashText = "missingno";
                 BufferedReader bufferedreader = null;
          
                 try
                 {
                     ArrayList arraylist = new ArrayList();
                     bufferedreader = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8));
                     String s;
          
                     while((s = bufferedreader.readLine()) != null)
                     {
                         s = s.trim();
          
                         if(!s.isEmpty())
                         {
                             arraylist.add(s);
                         }
                     }
          
                     if(!arraylist.isEmpty())
                     {
                         do
                         {
                             this.splashText = (String)arraylist.get(rand.nextInt(arraylist.size()));
                         }
                         while(this.splashText.hashCode() == 125780783);
                     }
                 }
                 catch(IOException ioexception1)
                 {
                     ;
                 }
                 finally
                 {
                     if(bufferedreader != null)
                     {
                         try
                         {
                             bufferedreader.close();
                         }
                         catch(IOException ioexception)
                         {
                             ;
                         }
                     }
                 }
          
                 this.updateCounter = rand.nextFloat();
                 this.field_92025_p = "";
          
                 if(!GLContext.getCapabilities().OpenGL20 && !OpenGlHelper.func_153193_b())
                 {
                     this.field_92025_p = I18n.format("title.oldgl1", new Object[0]);
                     this.field_146972_A = I18n.format("title.oldgl2", new Object[0]);
                     this.field_104024_v = "https://help.mojang.com/customer/portal/articles/325948?ref=game";
                 }
             }
          
             /**
              * Called from the main game loop to update the screen.
              */
             public void updateScreen()
             {
                 ++this.panoramaTimer;
             }
          
             /**
              * Returns true if this GUI should pause the game when it is displayed in single-player
              */
             public boolean doesGuiPauseGame()
             {
                 return false;
             }
          
             /**
              * 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.viewportTexture = new DynamicTexture(256, 256);
                 this.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture);
                 Calendar calendar = Calendar.getInstance();
                 calendar.setTime(new Date());
          
                 if(calendar.get(2) + 1 == 11 && calendar.get(5) == 9)
                 {
                     this.splashText = "Happy birthday, ez!";
                 }
                 else if(calendar.get(2) + 1 == 6 && calendar.get(5) == 1)
                 {
                     this.splashText = "Happy birthday, Notch!";
                 }
                 else if(calendar.get(2) + 1 == 12 && calendar.get(5) == 24)
                 {
                     this.splashText = "Merry X-mas!";
                 }
                 else if(calendar.get(2) + 1 == 1 && calendar.get(5) == 1)
                 {
                     this.splashText = "Happy new year!";
                 }
                 else if(calendar.get(2) + 1 == 10 && calendar.get(5) == 31)
                 {
                     this.splashText = "OOoooOOOoooo! Spooky!";
                 }
          
                 boolean flag = true;
                 int i = this.height / 4 + 48;
          
                 if(this.mc.isDemo())
                 {
                     this.addDemoButtons(i, 24);
                 }
                 else
                 {
                     this.addSingleplayerMultiplayerButtons(i, 24);
                 }
          
                 this.buttonList.add(new GuiButton(0, this.width / 2 - 100, i + 72 + 12, 98, 20, I18n.format("§dOptions", new Object[0])));
                 this.buttonList.add(new GuiButton(4, this.width / 2 + 2, i + 72 + 12, 98, 20, I18n.format("§7Quitter", new Object[0])));
                 }
          
             private void addSingleplayerMultiplayerButtons(int x, int y)
             {
                 this.buttonList.add(new GuiButton(1, this.width / 2 - 100, 236, 200, 20, I18n.format("§3Sodezlo")));
                 this.buttonList.add(new GuiButton(20, this.width / 2 - 100, 189 + y * 1, "§cFire Redemption"));
             }
          
             /**
              * Adds Demo buttons on Main Menu for players who are playing Demo.
              */
             private void addDemoButtons(int x, int y)
             {
                 this.buttonList.add(new GuiButton(11, this.width / 2 - 100, x, I18n.format("menu.playdemo", new Object[0])));
                 this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, x + y * 1, I18n.format("menu.resetdemo", new Object[0])));
                 ISaveFormat isaveformat = this.mc.getSaveLoader();
                 WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
          
                 if(worldinfo == null)
                 {
                     this.buttonResetDemo.enabled = false;
                 }
             }
          
             protected void actionPerformed(GuiButton button)
             {
                 if(button.id == 0)
                 {
                     this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
                 }
          
                 if(button.id == 5)
                 {
                     this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager()));
                 }
          
                 if(button.id == 1)
                 {
                     this.mc.displayGuiScreen(new GuiSelectWorld(this));
                 }
          
                 if(button.id == 2)
                 {
                     this.mc.displayGuiScreen(new GuiMultiplayer(this));
                 }
          
                 if(button.id == 4)
                 {
                     this.mc.shutdown();
                 }
          
                 if(button.id == 6)
                 {
                     this.mc.displayGuiScreen(new GuiModList(this));
                 }
          
                 if(button.id == 11)
                 {
                     this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
                 }
          
                 if(button.id == 12)
                 {
                     ISaveFormat isaveformat = this.mc.getSaveLoader();
                     WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
          
                     if(worldinfo != null)
                     {
                         GuiYesNo guiyesno = GuiSelectWorld.func_152129_a(this, worldinfo.getWorldName(), 12);
                         this.mc.displayGuiScreen(guiyesno);
                     }
                 }
          
                 if(button.id == 20)
                 {
                     // TODO pour la connexion au serveur
                     FMLClientHandler.instance().connectToServerAtStartup("46.105.178.115", 25565);
                 }
          
                 if(button.id == 21)
                 {
                     try
                     {
                         Class oclass = Class.forName("java.awt.Desktop");
                         Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
                         oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI("http://www.minecraftforgefrance.fr")});
                     }
                     catch(Throwable throwable)
                     {
                         logger.error("Couldn\'t open link", throwable);
                     }
                 }
             }
          
             public void confirmClicked(boolean p_73878_1_, int id)
             {
                 if(p_73878_1_ && id == 12)
                 {
                     ISaveFormat isaveformat = this.mc.getSaveLoader();
                     isaveformat.flushCache();
                     isaveformat.deleteWorldDirectory("Demo_World");
                     this.mc.displayGuiScreen(this);
                 }
                 else if(id == 13)
                 {
                     if(p_73878_1_)
                     {
                         try
                         {
                             Class oclass = Class.forName("java.awt.Desktop");
                             Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
                             oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI(this.field_104024_v)});
                         }
                         catch(Throwable throwable)
                         {
                             logger.error("Couldn\'t open link", throwable);
                         }
                     }
          
                     this.mc.displayGuiScreen(this);
                 }
             }
          
             private void renderBackGround()
             {
                 GL11.glViewport(0, 0, 256, 256);
                 this.mc.getTextureManager().bindTexture(backGround); 
                 GL11.glDisable(GL11.GL_TEXTURE_2D);
                 GL11.glEnable(GL11.GL_TEXTURE_2D);
                 GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
                 Tessellator tessellator = Tessellator.instance;
                 tessellator.startDrawingQuads();
                 GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
                 GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
                 tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
                 int k = this.width;
                 int l = this.height;
                 tessellator.addVertexWithUV(0, 0, this.zLevel, 0, 0);
                 tessellator.addVertexWithUV(0, l, this.zLevel, 0, 1);
                 tessellator.addVertexWithUV(k, l, this.zLevel, 1, 1);
                 tessellator.addVertexWithUV(k, 0, this.zLevel, 1, 0);
                 tessellator.draw();
             }
          
             public void drawScreen(int x, int y, float partialTick)
             {
                 GL11.glDisable(GL11.GL_ALPHA_TEST);
                 this.renderBackGround();
                 GL11.glEnable(GL11.GL_ALPHA_TEST);
                 Tessellator tessellator = Tessellator.instance;
                 short short1 = 274;
                 int k = this.width / 2 - short1 / 2;
                 byte b0 = 30;
                 this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
                 this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
                 this.mc.getTextureManager().bindTexture(minecraftTitleTextures);
                 GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
          
                 if((double)this.updateCounter < 1.0E-4D)
                 {
                     this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 99, 44);
                     this.drawTexturedModalRect(k + 99, b0 + 0, 129, 0, 27, 44);
                     this.drawTexturedModalRect(k + 99 + 26, b0 + 0, 126, 0, 3, 44);
                     this.drawTexturedModalRect(k + 99 + 26 + 3, b0 + 0, 99, 0, 26, 44);
                     this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44);
                 }
                 else
                 {
                     this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 155, 44);
                     this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44);
                 }
          
                 tessellator.setColorOpaque_I(-1);
                 GL11.glPushMatrix();
                 GL11.glTranslatef((float)(this.width / 2 + 90), 70.0F, 0.0F);
                 GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F);
                 float f1 = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F);
                 f1 = f1 * 100.0F / (float)(this.fontRendererObj.getStringWidth(this.splashText) + 32);
                 GL11.glScalef(f1, f1, f1);
                 this.drawCenteredString(this.fontRendererObj, this.splashText, 0, 111101118, 1000000256);
                 GL11.glPopMatrix();
                 String s = "ExoniaPVP";
          
                 if(this.mc.isDemo())
                 {
                     s = s + " Demo";
                 }
                 String s1 = "";
                 this.drawString(this.fontRendererObj, s1, this.width - this.fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1);
          
                 if(this.field_92025_p != null && this.field_92025_p.length() > 0)
                 {
                     drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 1428160512);
                     this.drawString(this.fontRendererObj, this.field_92025_p, this.field_92022_t, this.field_92021_u, -1);
                     this.drawString(this.fontRendererObj, this.field_146972_A, (this.width - this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, -1);
                 }
          
                 super.drawScreen(x, y, partialTick);
             }
          
             /**
              * Called when the mouse is clicked.
              */
             protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_)
             {
                 super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_);
                 Object object = this.field_104025_t;
          
                 synchronized(this.field_104025_t)
                 {
                     if(this.field_92025_p.length() > 0 && p_73864_1_ >= this.field_92022_t && p_73864_1_ <= this.field_92020_v && p_73864_2_ >= this.field_92021_u && p_73864_2_ <= this.field_92019_w)
                     {
                         GuiConfirmOpenLink guiconfirmopenlink = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true);
                         guiconfirmopenlink.func_146358_g();
                         this.mc.displayGuiScreen(guiconfirmopenlink);
                     }
                 }
             }
          }
          
          package com.mod.exonia;
          
          import java.io.File;
          
          import com.google.common.base.Throwables;
          import com.mod.exonia.dynamite.EntityDynamite;
          import com.mod.exonia.gui.GuiCustomMainMenu;
          import com.mod.exonia.init.BlockMod;
          import com.mod.exonia.init.ItemMod;
          import com.mod.exonia.proxy.CommonProxy;
          import com.mod.exonia.world.WorldRegister;
          
          import cpw.mods.fml.client.FMLClientHandler;
          import cpw.mods.fml.common.Mod;
          import cpw.mods.fml.common.Mod.EventHandler;
          import cpw.mods.fml.common.Mod.Instance;
          import cpw.mods.fml.common.SidedProxy;
          import cpw.mods.fml.common.event.FMLInitializationEvent;
          import cpw.mods.fml.common.event.FMLPostInitializationEvent;
          import cpw.mods.fml.common.event.FMLPreInitializationEvent;
          import cpw.mods.fml.common.eventhandler.SubscribeEvent;
          import cpw.mods.fml.common.gameevent.TickEvent;
          import cpw.mods.fml.common.registry.EntityRegistry;
          import cpw.mods.fml.relauncher.Side;
          import cpw.mods.fml.relauncher.SideOnly;
          import net.minecraft.client.Minecraft;
          import net.minecraft.client.gui.GuiIngameMenu;
          import net.minecraft.client.gui.GuiMainMenu;
          import net.minecraftforge.client.event.GuiOpenEvent;
          import net.minecraftforge.client.event.GuiScreenEvent;
          
          @Mod(modid = Reference.MOD_NAME, version = Reference.VERSION)
          
          public class Exonia
          {
              @SidedProxy(clientSide = Reference.CLIENT_PROXY, serverSide = Reference.SERVER_PROXY)
              public static CommonProxy proxy;
          
              @EventHandler
              public void preInit(FMLPreInitializationEvent event)
              {
                  BlockMod.init();
                  BlockMod.register();
                  ItemMod.init();
                  ItemMod.register();
                  WorldRegister.mainRegistry();
          
                  if(event.getSide().isClient())
                  {
                      if(!Minecraft.getMinecraft().mcDataDir.getAbsolutePath().contains("Exonia") && !Minecraft.getMinecraft().mcDataDir.equals(new File(".")))
                      {
                           Throwables.propagate(new Exception("Launcher non autorisé"));
          
                      }
                  }
              }
          
              @SubscribeEvent
              @SideOnly(Side.CLIENT)
              public void onGuiOpened(GuiOpenEvent event)
              {
                  if(event.gui instanceof GuiMainMenu)
                  {
                      event.gui = new GuiCustomMainMenu();
                  }
              }
          
              @EventHandler
              public void Init(FMLInitializationEvent event)
              {
                  proxy.registerRenders();
                  EntityRegistry.registerModEntity(EntityDynamite.class, "EntityDynamite", 420, Exonia.instance, 32, 20, false);
              }
          
              @EventHandler
              public void postInit(FMLPostInitializationEvent event)
              {
          
              }
          
              @Instance(Reference.MOD_NAME)
              public static Exonia instance;
          
          }
          
          

          Voila si on peu m’aider merci

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

            Tu as encore une méthode-event dans ta classe principale, pour display ton custom main menu. C’est inutile, 1 seule méthode-event, et non pas plusieurs, quand il s’agit d’effectuer la même action dans un mod !

            Remplace
            MinecraftForge.EVENT_BUS.register(GuiMainMenuEventHandler.class);
            Par
            MinecraftForge.EVENT_BUS.register(new GuiMainMenuEventHandler());

            Si ça ne marche pas, essaie de déplacer cette ligne dans ta méthode registerRenders()

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

              @‘Plaigon’:

              Tu as encore une méthode-event dans ta classe principale, pour display ton custom main menu. C’est inutile, 1 seule méthode-event, et non pas plusieurs, quand il s’agit d’effectuer la même action dans un mod !

              Remplace
              MinecraftForge.EVENT_BUS.register(GuiMainMenuEventHandler.class);
              Par
              MinecraftForge.EVENT_BUS.register(new GuiMainMenuEventHandler());

              Si ça ne marche pas, essaie de déplacer cette ligne dans ta méthode registerRenders()

              J’ai fait se que tu ma dit mais sa marche tjr pas mais mtn mon launcher crash carrement

              package com.mod.exonia.proxy;
              
              import com.mod.exonia.dynamite.EntityDynamite;
              import com.mod.exonia.gui.GuiCustomMainMenu;
              import com.mod.exonia.gui.GuiMainMenuEventHandler;
              import com.mod.exonia.init.ItemMod;
              
              import cpw.mods.fml.client.FMLClientHandler;
              import cpw.mods.fml.client.registry.RenderingRegistry;
              import cpw.mods.fml.common.FMLCommonHandler;
              import cpw.mods.fml.common.eventhandler.SubscribeEvent;
              import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
              import cpw.mods.fml.relauncher.Side;
              import cpw.mods.fml.relauncher.SideOnly;
              import net.minecraft.client.Minecraft;
              import net.minecraft.client.gui.GuiIngameMenu;
              import net.minecraft.client.gui.GuiMainMenu;
              import net.minecraft.client.renderer.entity.RenderSnowball;
              import net.minecraft.client.settings.KeyBinding;
              import net.minecraftforge.client.event.GuiOpenEvent;
              import net.minecraftforge.common.MinecraftForge;
              
              public class ClientProxy extends CommonProxy
              {
              
                  public static KeyBinding keyBinding;
              
                  @Override
                  public void registerRenders()
                  {
                      RenderingRegistry.registerEntityRenderingHandler(EntityDynamite.class, new RenderSnowball(ItemMod.dynamite));
                      MinecraftForge.EVENT_BUS.register(new GuiMainMenuEventHandler());
                  }
              
                  public ClientProxy()
                  {
                      FMLCommonHandler.instance().bus().register(new GuiMainMenuEventHandler());
                  }
              
                  @SubscribeEvent
                  public void onEvent(KeyInputEvent event)
                  {
              
                  }
              
                  private void keyPressed()
                  {
              
                  }
              
              }
              
              1 réponse Dernière réponse Répondre Citer 0
              • DeletedD Hors-ligne
                Deleted
                dernière édition par

                Le crash report ?

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

                  @‘Plaigon’:

                  Le crash report ?

                  [21:32:07] [main/INFO] [GradleStart]: Extra: []
                  [21:32:07] [main/INFO] [GradleStart]: Running with arguments: [–userProperties, {}, --assetsDir, C:/Users/Zokyt/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker]
                  [21:32:07] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker
                  [21:32:07] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker
                  [21:32:07] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker
                  [21:32:07] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker
                  [21:32:07] [main/INFO] [FML]: Forge Mod Loader version 7.99.40.1614 for Minecraft 1.7.10 loading
                  [21:32:07] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_121, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jdk1.8.0_121\jre
                  [21:32:07] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
                  [21:32:07] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker
                  [21:32:07] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin
                  [21:32:07] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin
                  [21:32:07] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
                  [21:32:07] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
                  [21:32:07] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
                  [21:32:07] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
                  [21:32:07] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
                  [21:32:07] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
                  [21:32:07] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!
                  [21:32:09] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing
                  [21:32:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
                  [21:32:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker
                  [21:32:09] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker
                  [21:32:09] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker
                  [21:32:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker
                  [21:32:09] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}
                  [21:32:11] [main/INFO]: Setting user: Player604
                  [21:32:14] [Client thread/INFO]: LWJGL Version: 2.9.1
                  [21:32:15] [Client thread/INFO] [STDOUT]: [cpw.mods.fml.client.SplashProgress:start:188]: –-- Minecraft Crash Report ----
                  // I just don't know what went wrong :(
                  
                  Time: 13/06/17 21:32
                  Description: Loading screen debug info
                  
                  This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR
                  
                  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_121, Oracle Corporation
                  Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                  Memory: 805887264 bytes (768 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: 
                  GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 376.53' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2'
                  [21:32:15] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
                  [21:32:15] [Client thread/INFO] [FML]: MinecraftForge v10.13.4.1614 Initialized
                  [21:32:15] [Client thread/INFO] [FML]: Replaced 183 ore recipies
                  [21:32:15] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
                  [21:32:16] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
                  [21:32:16] [Client thread/INFO] [FML]: Searching C:\Users\Zokyt\Desktop\forge-1.7.10-10.13.4.1614-1.7.10-src\eclipse\mods for mods
                  [21:32:16] [Client thread/INFO] [Exonia]: Mod Exonia is missing the required element 'name'. Substituting Exonia
                  [21:32:22] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load
                  [21:32:23] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, Exonia] at CLIENT
                  [21:32:23] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, Exonia] at SERVER
                  [21:32:23] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Exonia
                  [21:32:24] [Client thread/INFO] [FML]: Processing ObjectHolder annotations
                  [21:32:24] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations
                  [21:32:24] [Client thread/INFO] [FML]: Identifying ItemStackHolder annotations
                  [21:32:24] [Client thread/INFO] [FML]: Found 0 ItemStackHolder annotations
                  [21:32:24] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0
                  [21:32:24] [Client thread/INFO] [FML]: Applying holder lookups
                  [21:32:24] [Client thread/INFO] [FML]: Holder lookups applied
                  [21:32:24] [Client thread/INFO] [FML]: Injecting itemstacks
                  [21:32:24] [Client thread/INFO] [FML]: Itemstack injection complete
                  [21:32:24] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
                  [21:32:24] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
                  [21:32:24] [Thread-7/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
                  [21:32:24] [Thread-7/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
                  [21:32:24] [Thread-7/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
                  [21:32:24] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
                  [21:32:24] [Sound Library Loader/INFO]: Sound engine started
                  [21:32:25] [Client thread/INFO]: Created: 16x16 textures/blocks-atlas
                  [21:32:26] [Client thread/INFO]: Created: 16x16 textures/items-atlas
                  [21:32:26] [Client thread/INFO] [FML]: Injecting itemstacks
                  [21:32:26] [Client thread/INFO] [FML]: Itemstack injection complete
                  [21:32:26] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods
                  [21:32:26] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Exonia
                  [21:32:27] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas
                  [21:32:27] [Client thread/INFO]: Created: 512x256 textures/items-atlas
                  [21:32:27] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
                  [21:32:27] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down…
                  [21:32:27] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]:     Author: Paul Lamb, www.paulscode.com
                  [21:32:27] [Client thread/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
                  [21:32:27] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
                  [21:32:27] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem…
                  [21:32:27] [Thread-9/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL
                  [21:32:27] [Thread-9/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:     (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)
                  [21:32:27] [Thread-9/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.
                  [21:32:28] [Sound Library Loader/INFO] [STDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: 
                  [21:32:28] [Sound Library Loader/INFO]: Sound engine started
                  [21:32:28] [Client thread/ERROR] [FML]: Exception caught during firing event net.minecraftforge.client.event.GuiOpenEvent@18c35c73:
                  java.lang.IncompatibleClassChangeError: Expecting non-static method com.mod.exonia.gui.GuiMainMenuEventHandler.onGuiOpens(Lnet/minecraftforge/client/event/GuiOpenEvent;)V
                  at cpw.mods.fml.common.eventhandler.ASMEventHandler_0_GuiMainMenuEventHandler_onGuiOpens_GuiOpenEvent.invoke(.dynamic) ~[?:?]
                  at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) ~[ASMEventHandler.class:?]
                  at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140) [EventBus.class:?]
                  at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:843) [Minecraft.class:?]
                  at net.minecraft.client.Minecraft.startGame(Minecraft.java:607) [Minecraft.class:?]
                  at net.minecraft.client.Minecraft.run(Minecraft.java:942) [Minecraft.class:?]
                  at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]
                  at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]
                  at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
                  at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
                  at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]
                  at GradleStart.main(Unknown Source) [start/:?]
                  [21:32:28] [Client thread/ERROR] [FML]: Index: 1 Listeners:
                  [21:32:28] [Client thread/ERROR] [FML]: 0: NORMAL
                  [21:32:28] [Client thread/ERROR] [FML]: 1: ASM: com.mod.exonia.gui.GuiMainMenuEventHandler@2ef73704 onGuiOpens(Lnet/minecraftforge/client/event/GuiOpenEvent;)V
                  [21:32:28] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ----
                  // Don't be sad. I'll do better next time, I promise!
                  
                  Time: 13/06/17 21:32
                  Description: Initializing game
                  
                  java.lang.IncompatibleClassChangeError: Expecting non-static method com.mod.exonia.gui.GuiMainMenuEventHandler.onGuiOpens(Lnet/minecraftforge/client/event/GuiOpenEvent;)V
                  at cpw.mods.fml.common.eventhandler.ASMEventHandler_0_GuiMainMenuEventHandler_onGuiOpens_GuiOpenEvent.invoke(.dynamic)
                  at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
                  at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
                  at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:843)
                  at net.minecraft.client.Minecraft.startGame(Minecraft.java:607)
                  at net.minecraft.client.Minecraft.run(Minecraft.java:942)
                  at net.minecraft.client.main.Main.main(Main.java:164)
                  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:498)
                  at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                  at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                  at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
                  at GradleStart.main(Unknown Source)
                  
                  A detailed walkthrough of the error, its code path and all known details is as follows:
                  ---------------------------------------------------------------------------------------
                  
                  -- Head --
                  Stacktrace:
                  at cpw.mods.fml.common.eventhandler.ASMEventHandler_0_GuiMainMenuEventHandler_onGuiOpens_GuiOpenEvent.invoke(.dynamic)
                  at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54)
                  at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:140)
                  at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:843)
                  at net.minecraft.client.Minecraft.startGame(Minecraft.java:607)
                  
                  -- Initialization --
                  Details:
                  Stacktrace:
                  at net.minecraft.client.Minecraft.run(Minecraft.java:942)
                  at net.minecraft.client.main.Main.main(Main.java:164)
                  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:498)
                  at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
                  at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
                  at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)
                  at GradleStart.main(Unknown Source)
                  
                  -- System Details --
                  Details:
                  Minecraft Version: 1.7.10
                  Operating System: Windows 10 (amd64) version 10.0
                  Java Version: 1.8.0_121, Oracle Corporation
                  Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
                  Memory: 661815784 bytes (631 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
                  UCHIJA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
                  UCHIJA FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) 
                  UCHIJA Forge{10.13.4.1614} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1614-1.7.10.jar) 
                  UCHIJA Exonia{1.0.0} [Exonia] (bin) 
                  GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 376.53' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2'
                  Launched Version: 1.7.10
                  LWJGL: 2.9.1
                  OpenGL: GeForce GTX 750 Ti/PCIe/SSE2 GL version 4.5.0 NVIDIA 376.53, NVIDIA Corporation
                  GL Caps: Using GL 1.3 multitexturing.
                  Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
                  Anisotropic filtering is supported and maximum anisotropy is 16.
                  Shaders are available because OpenGL 2.1 is supported.
                  
                  Is Modded: Definitely; Client brand changed to 'fml,forge'
                  Type: Client (map_client.txt)
                  Resource Packs: []
                  Current Language: Français (France)
                  Profiler Position: N/A (disabled)
                  Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
                  Anisotropic Filtering: Off (1)
                  [21:32:28] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Zokyt\Desktop\forge-1.7.10-10.13.4.1614-1.7.10-src\eclipse\.\crash-reports\crash-2017-06-13_21.32.28-client.txt
                  AL lib: (EE) alc_cleanup: 1 device not closed
                  Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
                  
                  
                  1 réponse Dernière réponse Répondre Citer 0
                  • DeletedD Hors-ligne
                    Deleted
                    dernière édition par

                    Les méthodes-event, ne doivent jamais être static.

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

                      @‘Plaigon’:

                      Les méthodes-event, ne doivent jamais être static.

                      Ducoup je dois faire quoi ?

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

                        Apprendre le Java

                        EDIT = Ou au moins la POO, ce sera déjà bien

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

                          @‘Plaigon’:

                          Apprendre le Java

                          EDIT = Ou au moins la POO, ce sera déjà bien

                          Bh je connai les base mais comment je modifie
                          Mais je fait comment pour enlever les static ?

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

                            Non, si tu poses ce genre de question, c’est que tu n’as pas les bases.

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

                              @‘Plaigon’:

                              Non, si tu poses ce genre de question, c’est que tu n’as pas les bases.

                              Mais comment j’enleve les static de la méthode event ?

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

                                Tu vois, tu as un petit mot clé coloré "static’ juste avant le type de ta méthode (“void”).
                                Sur ton clavier, tu peux t’apercevoir qu’il existe une touche retour située au-dessus de la touche entrée. Et normalement, si ton installation est fonctionnelle, celle-ci devrait te permettre d’enlever des caractères à ton code. Ainsi en appuyant 6 fois dessus, en partant du ‘c’ de static, tu pourras avec un peu de chance (faut avoir la technique, hein ?), faire en sorte que ta méthode ne soit plus static.
                                J’espère que ce long message te permettra à l’avenir de ne plus rencontrer ce crash report.

                                1 réponse Dernière réponse Répondre Citer 1
                                • Z Hors-ligne
                                  Zokyt
                                  dernière édition par

                                  @‘Plaigon’:

                                  Tu vois, tu as un petit mot clé coloré "static’ juste avant le type de ta méthode (“void”).
                                  Sur ton clavier, tu peux t’apercevoir qu’il existe une touche retour située au-dessus de la touche entrée. Et normalement, si ton installation est fonctionnelle, celle-ci devrait te permettre d’enlever des caractères à ton code. Ainsi en appuyant 6 fois dessus, en partant du ‘c’ de static, tu pourras avec un peu de chance (faut avoir la technique, hein ?), faire en sorte que ta méthode ne soit plus static, c’est-à-dire qu’elle soit commune à toute les instances de ta classe d’event handler (ce qui est ridicule, puisque tu es censée n’avoir qu’une seule instance, enfin bref…).
                                  J’espère que ce long message te permettra à l’avenir de ne plus rencontre ce crash report.

                                  A sa ces bon mrc j’ai reussi ^^


                                  Est j’ai une question vite fait stp dans la bar blanche tout en haut de minecraft ces marquer “Minecraft 1.7.10” Comment je modifi stp ?

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

                                    Display.setTitle dans ta méthode preInit

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

                                      est je trouve ou les image du jeu ?

                                      package com.mod.exonia.gui;
                                      
                                      import java.io.BufferedReader;
                                      import java.io.IOException;
                                      import java.io.InputStreamReader;
                                      import java.net.URI;
                                      import java.util.ArrayList;
                                      import java.util.Calendar;
                                      import java.util.Date;
                                      import java.util.Random;
                                      
                                      import org.apache.commons.io.Charsets;
                                      import org.apache.logging.log4j.LogManager;
                                      import org.apache.logging.log4j.Logger;
                                      import org.lwjgl.opengl.GL11;
                                      import org.lwjgl.opengl.GLContext;
                                      
                                      import cpw.mods.fml.client.FMLClientHandler;
                                      import cpw.mods.fml.client.GuiModList;
                                      import cpw.mods.fml.relauncher.Side;
                                      import cpw.mods.fml.relauncher.SideOnly;
                                      import net.minecraft.client.Minecraft;
                                      import net.minecraft.client.gui.GuiButton;
                                      import net.minecraft.client.gui.GuiConfirmOpenLink;
                                      import net.minecraft.client.gui.GuiLanguage;
                                      import net.minecraft.client.gui.GuiMultiplayer;
                                      import net.minecraft.client.gui.GuiOptions;
                                      import net.minecraft.client.gui.GuiScreen;
                                      import net.minecraft.client.gui.GuiSelectWorld;
                                      import net.minecraft.client.gui.GuiYesNo;
                                      import net.minecraft.client.gui.GuiYesNoCallback;
                                      import net.minecraft.client.renderer.OpenGlHelper;
                                      import net.minecraft.client.renderer.Tessellator;
                                      import net.minecraft.client.renderer.texture.DynamicTexture;
                                      import net.minecraft.client.resources.I18n;
                                      import net.minecraft.util.EnumChatFormatting;
                                      import net.minecraft.util.MathHelper;
                                      import net.minecraft.util.ResourceLocation;
                                      import net.minecraft.world.demo.DemoWorldServer;
                                      import net.minecraft.world.storage.ISaveFormat;
                                      import net.minecraft.world.storage.WorldInfo;
                                      
                                      @SideOnly(Side.CLIENT)
                                      public class GuiCustomMainMenu extends GuiScreen implements GuiYesNoCallback
                                      {
                                        private static final Logger logger = LogManager.getLogger();
                                        /** The RNG used by the Main Menu Screen. */
                                        private static final Random rand = new Random();
                                        /** Counts the number of screen updates. */
                                        private float updateCounter;
                                        /** The splash message. */
                                        private String splashText;
                                        private GuiButton buttonResetDemo;
                                        /** Timer used to rotate the panorama, increases every tick. */
                                        private int panoramaTimer;
                                        /**
                                         * Texture allocated for the current viewport of the main menu's panorama background.
                                         */
                                        private DynamicTexture viewportTexture;
                                        private final Object field_104025_t = new Object();
                                        private String field_92025_p;
                                        private String field_146972_A;
                                        private String field_104024_v;
                                        private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt");
                                        private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png");
                                        /** An array of all the paths to the panorama pictures. */
                                        private final ResourceLocation backGround = new ResourceLocation("moreitemfr", "textures/gui/menu.png");
                                        public static final String field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information.";
                                        private int field_92024_r;
                                        private int field_92023_s;
                                        private int field_92022_t;
                                        private int field_92021_u;
                                        private int field_92020_v;
                                        private int field_92019_w;
                                        private ResourceLocation field_110351_G;
                                        private static final String __OBFID = "CL_00001154";
                                      
                                        public GuiCustomMainMenu()
                                        {
                                            this.field_146972_A = field_96138_a;
                                            this.splashText = "missingno";
                                            BufferedReader bufferedreader = null;
                                      
                                            try
                                            {
                                                ArrayList arraylist = new ArrayList();
                                                bufferedreader = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8));
                                                String s;
                                      
                                                while((s = bufferedreader.readLine()) != null)
                                                {
                                                    s = s.trim();
                                      
                                                    if(!s.isEmpty())
                                                    {
                                                        arraylist.add(s);
                                                    }
                                                }
                                      
                                                if(!arraylist.isEmpty())
                                                {
                                                    do
                                                    {
                                                        this.splashText = (String)arraylist.get(rand.nextInt(arraylist.size()));
                                                    }
                                                    while(this.splashText.hashCode() == 125780783);
                                                }
                                            }
                                            catch(IOException ioexception1)
                                            {
                                                ;
                                            }
                                            finally
                                            {
                                                if(bufferedreader != null)
                                                {
                                                    try
                                                    {
                                                        bufferedreader.close();
                                                    }
                                                    catch(IOException ioexception)
                                                    {
                                                        ;
                                                    }
                                                }
                                            }
                                      
                                            this.updateCounter = rand.nextFloat();
                                            this.field_92025_p = "";
                                      
                                            if(!GLContext.getCapabilities().OpenGL20 && !OpenGlHelper.func_153193_b())
                                            {
                                                this.field_92025_p = I18n.format("title.oldgl1", new Object[0]);
                                                this.field_146972_A = I18n.format("title.oldgl2", new Object[0]);
                                                this.field_104024_v = "https://help.mojang.com/customer/portal/articles/325948?ref=game";
                                            }
                                        }
                                      
                                        /**
                                         * Called from the main game loop to update the screen.
                                         */
                                        public void updateScreen()
                                        {
                                            ++this.panoramaTimer;
                                        }
                                      
                                        /**
                                         * Returns true if this GUI should pause the game when it is displayed in single-player
                                         */
                                        public boolean doesGuiPauseGame()
                                        {
                                            return false;
                                        }
                                      
                                        /**
                                         * 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.viewportTexture = new DynamicTexture(256, 256);
                                            this.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture);
                                            Calendar calendar = Calendar.getInstance();
                                            calendar.setTime(new Date());
                                      
                                            if(calendar.get(2) + 1 == 11 && calendar.get(5) == 9)
                                            {
                                                this.splashText = "Happy birthday, ez!";
                                            }
                                            else if(calendar.get(2) + 1 == 6 && calendar.get(5) == 1)
                                            {
                                                this.splashText = "Happy birthday, Notch!";
                                            }
                                            else if(calendar.get(2) + 1 == 12 && calendar.get(5) == 24)
                                            {
                                                this.splashText = "Merry X-mas!";
                                            }
                                            else if(calendar.get(2) + 1 == 1 && calendar.get(5) == 1)
                                            {
                                                this.splashText = "Happy new year!";
                                            }
                                            else if(calendar.get(2) + 1 == 10 && calendar.get(5) == 31)
                                            {
                                                this.splashText = "OOoooOOOoooo! Spooky!";
                                            }
                                      
                                            boolean flag = true;
                                            int i = this.height / 4 + 48;
                                      
                                            if(this.mc.isDemo())
                                            {
                                                this.addDemoButtons(i, 24);
                                            }
                                            else
                                            {
                                                this.addSingleplayerMultiplayerButtons(i, 24);
                                            }
                                      
                                            this.buttonList.add(new GuiButton(0, this.width / 2 - 100, i + 72 + 12, 98, 20, I18n.format("§dOptions", new Object[0])));
                                            this.buttonList.add(new GuiButton(4, this.width / 2 + 2, i + 72 + 12, 98, 20, I18n.format("§7Quitter", new Object[0])));
                                            }
                                      
                                        private void addSingleplayerMultiplayerButtons(int x, int y)
                                        {
                                            this.buttonList.add(new GuiButton(1, this.width / 2 - 100, 7, 200, 20, I18n.format("§3Solo")));
                                            this.buttonList.add(new GuiButton(20, this.width / 2 - 100, 90 + y * 1, "§cExonia"));
                                        }
                                      
                                        /**
                                         * Adds Demo buttons on Main Menu for players who are playing Demo.
                                         */
                                        private void addDemoButtons(int x, int y)
                                        {
                                            this.buttonList.add(new GuiButton(11, this.width / 2 - 100, x, I18n.format("menu.playdemo", new Object[0])));
                                            this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, x + y * 1, I18n.format("menu.resetdemo", new Object[0])));
                                            ISaveFormat isaveformat = this.mc.getSaveLoader();
                                            WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
                                      
                                            if(worldinfo == null)
                                            {
                                                this.buttonResetDemo.enabled = false;
                                            }
                                        }
                                      
                                        protected void actionPerformed(GuiButton button)
                                        {
                                            if(button.id == 0)
                                            {
                                                this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
                                            }
                                      
                                            if(button.id == 5)
                                            {
                                                this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager()));
                                            }
                                      
                                            if(button.id == 1)
                                            {
                                                this.mc.displayGuiScreen(new GuiSelectWorld(this));
                                            }
                                      
                                            if(button.id == 2)
                                            {
                                                this.mc.displayGuiScreen(new GuiMultiplayer(this));
                                            }
                                      
                                            if(button.id == 4)
                                            {
                                                this.mc.shutdown();
                                            }
                                      
                                            if(button.id == 6)
                                            {
                                                this.mc.displayGuiScreen(new GuiModList(this));
                                            }
                                      
                                            if(button.id == 11)
                                            {
                                                this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
                                            }
                                      
                                            if(button.id == 12)
                                            {
                                                ISaveFormat isaveformat = this.mc.getSaveLoader();
                                                WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
                                      
                                                if(worldinfo != null)
                                                {
                                                    GuiYesNo guiyesno = GuiSelectWorld.func_152129_a(this, worldinfo.getWorldName(), 12);
                                                    this.mc.displayGuiScreen(guiyesno);
                                                }
                                            }
                                      
                                            if(button.id == 20)
                                            {
                                                // TODO pour la connexion au serveur
                                                FMLClientHandler.instance().connectToServerAtStartup("ip01.srv01.fatareborn.net", 25565);
                                            }
                                      
                                            if(button.id == 21)
                                            {
                                                try
                                                {
                                                    Class oclass = Class.forName("java.awt.Desktop");
                                                    Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
                                                    oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI("http://www.minecraftforgefrance.fr")});
                                                }
                                                catch(Throwable throwable)
                                                {
                                                    logger.error("Couldn\'t open link", throwable);
                                                }
                                            }
                                        }
                                      
                                        public void confirmClicked(boolean p_73878_1_, int id)
                                        {
                                            if(p_73878_1_ && id == 12)
                                            {
                                                ISaveFormat isaveformat = this.mc.getSaveLoader();
                                                isaveformat.flushCache();
                                                isaveformat.deleteWorldDirectory("Demo_World");
                                                this.mc.displayGuiScreen(this);
                                            }
                                            else if(id == 13)
                                            {
                                                if(p_73878_1_)
                                                {
                                                    try
                                                    {
                                                        Class oclass = Class.forName("java.awt.Desktop");
                                                        Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
                                                        oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI(this.field_104024_v)});
                                                    }
                                                    catch(Throwable throwable)
                                                    {
                                                        logger.error("Couldn\'t open link", throwable);
                                                    }
                                                }
                                      
                                                this.mc.displayGuiScreen(this);
                                            }
                                        }
                                      
                                        private void renderBackGround()
                                        {
                                            GL11.glViewport(0, 0, 256, 256);
                                            this.mc.getTextureManager().bindTexture(backGround);
                                            GL11.glDisable(GL11.GL_TEXTURE_2D);
                                            GL11.glEnable(GL11.GL_TEXTURE_2D);
                                            GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
                                            Tessellator tessellator = Tessellator.instance;
                                            tessellator.startDrawingQuads();
                                            GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
                                            GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
                                            tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F);
                                            int k = this.width;
                                            int l = this.height;
                                            tessellator.addVertexWithUV(0, 0, this.zLevel, 0, 0);
                                            tessellator.addVertexWithUV(0, l, this.zLevel, 0, 1);
                                            tessellator.addVertexWithUV(k, l, this.zLevel, 1, 1);
                                            tessellator.addVertexWithUV(k, 0, this.zLevel, 1, 0);
                                            tessellator.draw();
                                        }
                                      
                                        public void drawScreen(int x, int y, float partialTick)
                                        {
                                            GL11.glDisable(GL11.GL_ALPHA_TEST);
                                            this.renderBackGround();
                                            GL11.glEnable(GL11.GL_ALPHA_TEST);
                                            Tessellator tessellator = Tessellator.instance;
                                            short short1 = 274;
                                            int k = this.width / 2 - short1 / 2;
                                            byte b0 = 30;
                                            this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
                                            this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
                                            this.mc.getTextureManager().bindTexture(minecraftTitleTextures);
                                            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                                      
                                            if((double)this.updateCounter < 1.0E-4D)
                                            {
                                                this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 99, 44);
                                                this.drawTexturedModalRect(k + 99, b0 + 0, 129, 0, 27, 44);
                                                this.drawTexturedModalRect(k + 99 + 26, b0 + 0, 126, 0, 3, 44);
                                                this.drawTexturedModalRect(k + 99 + 26 + 3, b0 + 0, 99, 0, 26, 44);
                                                this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44);
                                            }
                                            else
                                            {
                                                this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 155, 44);
                                                this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44);
                                            }
                                      
                                            tessellator.setColorOpaque_I(-1);
                                            GL11.glPushMatrix();
                                            GL11.glTranslatef((float)(this.width / 2 + 90), 70.0F, 0.0F);
                                            GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F);
                                            float f1 = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F);
                                            f1 = f1 * 100.0F / (float)(this.fontRendererObj.getStringWidth(this.splashText) + 32);
                                            GL11.glScalef(f1, f1, f1);
                                            this.drawCenteredString(this.fontRendererObj, this.splashText, 0, 111101118, 1000000256);
                                            GL11.glPopMatrix();
                                            String s = "ExoniaPVP";
                                      
                                            if(this.mc.isDemo())
                                            {
                                                s = s + " Demo";
                                            }
                                            String s1 = "";
                                            this.drawString(this.fontRendererObj, s1, this.width - this.fontRendererObj.getStringWidth(s1) - 2, this.height - 10, -1);
                                      
                                            if(this.field_92025_p != null && this.field_92025_p.length() > 0)
                                            {
                                                drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 1428160512);
                                                this.drawString(this.fontRendererObj, this.field_92025_p, this.field_92022_t, this.field_92021_u, -1);
                                                this.drawString(this.fontRendererObj, this.field_146972_A, (this.width - this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, -1);
                                            }
                                      
                                            super.drawScreen(x, y, partialTick);
                                        }
                                      
                                        /**
                                         * Called when the mouse is clicked.
                                         */
                                        protected void mouseClicked(int p_73864_1_, int p_73864_2_, int p_73864_3_)
                                        {
                                            super.mouseClicked(p_73864_1_, p_73864_2_, p_73864_3_);
                                            Object object = this.field_104025_t;
                                      
                                            synchronized(this.field_104025_t)
                                            {
                                                if(this.field_92025_p.length() > 0 && p_73864_1_ >= this.field_92022_t && p_73864_1_ <= this.field_92020_v && p_73864_2_ >= this.field_92021_u && p_73864_2_ <= this.field_92019_w)
                                                {
                                                    GuiConfirmOpenLink guiconfirmopenlink = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true);
                                                    guiconfirmopenlink.func_146358_g();
                                                    this.mc.displayGuiScreen(guiconfirmopenlink);
                                                }
                                            }
                                        }
                                      }
                                      
                                      1 réponse Dernière réponse Répondre Citer 0
                                      • BrokenSwingB Hors-ligne
                                        BrokenSwing Moddeurs confirmés Rédacteurs
                                        dernière édition par

                                        @Plaigon Les méthodes d’event peuvent être static si justement tu enregistres la classe et non une instance de la classe

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

                                          D’acc, il fait comme il veut après.

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

                                            Les images correspondent aux fields de type ResourceLocation, tu peux faire un ctrl+f pour les trouver.

                                            Si je vous ai aidé, n'oubliez pas d’être heureux, j'aiderai encore +

                                            AymericRed, moddeur expérimenté qui aide sur ce forum et qui peut accepter de faire un mod Forge rémunéré de temps en temps.

                                            Mes tutos : Table de craft, plugin NEI, plugin JEI, modifier l'overlay
                                            Je suis un membre apprécié et joueur, j'ai déjà obtenu 6 points de réputation.

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

                                            MINECRAFT FORGE FRANCE © 2024

                                            Powered by NodeBB