Menu principal animé 1.8.1 -> 1.7.10
-
Bizarre que ce code marche bien en beta 1.8.1 et plus en 1.7.10
Enfin bref je vais faire ce que tu me dis alors
-
Bon je me suis recréer un nouveau gui, j’ai (on va dire) réussi à dessiner le modèle 3d du joueur dans le menu grâce au tot de Amateis

Mais c’est quelque peu bugué
Regardez le screen :

Mon codeprivate static ModelBiped testModel = new ModelBiped(); private static final ResourceLocation texture = new ResourceLocation("textures/entity/steve.png"); public void createPlayer(int par1, int par2, float par3) { GL11.glPushMatrix(); GL11.glScalef(1.0F, 1.0F, 1.0F); GL11.glColor3f(1.0F, 1.0F, 1.0F); drawModelPlayerModel(par1, par2, par3); GL11.glPopMatrix(); } private void drawModelPlayerModel(int par1, int par2, float par3) { GL11.glPushMatrix(); GL11.glMatrixMode(5889); GL11.glPushMatrix(); GL11.glLoadIdentity(); ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); GL11.glViewport((scaledresolution.getScaledWidth() - 140) / 2 * scaledresolution.getScaleFactor(), (scaledresolution.getScaledHeight() - 140) / 2 * scaledresolution.getScaleFactor(), 512 * scaledresolution.getScaleFactor(), 300 * scaledresolution.getScaleFactor()); GL11.glTranslatef(-0.75F, -0.1F, 0.0F); //Ici ça gère les dimensions du modèle, largeur, hauteur, longueur //Il est préconfiguré pour un cube ! //S'cadeau c'est bonus ! //A modifier si vous voulez faire le rendu d'un mob ! GL11.glScalef(0.66F, 0.85F, 0.66F); //Permet d'afficher le modèle sous un certain angle Project.gluPerspective(90.599998F, 1.333333F, 9.0F, 180.0F); //Distance de vue (FOV) du modèle dans le "cube invisible" //Essayez 2.0F et vous verrez il sort de l'ecran, c'est de la vraie 3D ! //Non c'est une blague, mais ça zoom pas mal ! float f1 = 1.0F; //A ne pas modifier c'est comme le 5889 d'en haut, et à ce stade j'ai l'impression que c'est comme des ID GL11.glMatrixMode(5888); GL11.glLoadIdentity(); //Pour une jolie luminosité du modèle RenderHelper.enableStandardItemLighting(); //C'est subtile, ça permet de bouger la vue 2D du modèle dans le "cube invisible" si vous modifiez -16.0F //Par -17 ou -18 on le voit sortir par l'arrière du "cube invisible" GL11.glTranslatef(0.0F, -3.6F, -16.0F); //Le FOV GL11.glScalef(f1, f1, f1); //Définit les proportions du modèle un peu comme…. //GL11.glScalef(0.66F, 0.85F, 0.66F); //Mais cette fois si c'est grossier GL11.glScalef(4.0F, 4.0F, 4.0F); //Alors là c'est un peu spécial et marrant ! //Ça permet de rotate le modèle //Mais si vous mettez 20.0F différent de la même méthode un peu plus bas //On peu étirer le modèle, le déformer ! GL11.glRotatef(20.0F, -1.0F, 0.0F, 0.0F); //Applique la texture au Modèle this.mc.getTextureManager().bindTexture(texture); //Expliqué un peu plus haut GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F); //La profondeur du "cube invisible" mais je ne suis pas sûr ! float f3 = this.field_74208_u + (this.field_74209_t - this.field_74208_u) * par1; GL11.glTranslatef((1.0F - f3) * 0.2F, (1.0F - f3) * 0.1F, (1.0F - f3) * 0.25F); //Donne de l'épaisseur au modèle, à vous de voir ! GL11.glScalef(1.1F, 1.1F, 0.5F); //Fixe la texture sur le bloc, mob ... //Empêche la texture de changer de position, de pivoter sur elle même GL11.glRotatef(-(1.0F - f3) * 90.0F - 90.0F, 0.0F, 1.0F, 0.0F); //Et une tête à l'envers, UNE ! //Fait pivoter le modèle GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); GL11.glEnable(32826); //Appel de la fonction render() du ModelTROISD testModel.render(Minecraft.getMinecraft().thePlayer, 0.0F, 0.0F, 18.0555F, 0.0F, 0.0F, 0.0625F); GL11.glDisable(32826); RenderHelper.disableStandardItemLighting(); GL11.glMatrixMode(5889); GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); GL11.glPopMatrix(); GL11.glMatrixMode(5888); GL11.glPopMatrix(); //Désactive la luminosité du rendu RenderHelper.disableStandardItemLighting(); } -
testModel.render(Minecraft.getMinecraft().thePlayer, 0.0F, 0.0F, 18.0555F, 0.0F, 0.0F, 0.0625F);
->
testModel.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
De toute façon Minecraft.getMinecraft().thePlayer est null. Et la valeur 18.0555F n’a rien à faire là.
Après faudrait peut-être jouer avec les rotations. -
Pourquoi le model du pig apparaît bien et pas celui du joueur, alors ?
-
Ah, tu as utilisé ModelBiped. Essayes plutôt avec ModelPlayer.
Et pour répondre à ta question, aucune idée. -
ModelPlayer n’existe pas, c’est ModelBiped, J’avais déjà regardé avant x)
-
Ah oui, tu es en 1.7.10 x)
J’ai trop l’habitude de la 1.8. -
Ouais faudrait peut-être que je me mette à la 1.8 1 de ces 4 quand même x)
Ok alors le bug du model venait du resource pack. Donc pour le model c’est bon
Ensuite que dois-je faire ? Reprendre mon système et virer la condition de si le monde est null, on charge une map, nan ? -
Non, il faut charger le skin du joueur.
-
Bah ça à la limite, je pourrai le faire plus tard c’est pas la priorité
-
Petit up avec cette fois beaucoup plus d’info car je pense que tout le monde n’a pas forcément compris ce que je désirais x)
Ce que je veux comme menu c’est ça. -
Ah oui … Ce n’est pas du tout ce que titre demande …
Tu aurai dû directement demander comment rendre un monde dans le menu principal. Et ça je ne sais pas faire. -
Oui ce n’était pas très explicite, mais même avec le code de la béta, tu ne vois pas comment faire, ou quelqu’un d’autre ? Je veux dire c’est pas ce qu’il y’a de plus compliqué, nan ? ^^’
PS = dans mon premier message, j’avais dit comment charger un mode, c’est un peu pareil

-
Oui c’est moi aussi qui a mal compris, j’ai lu la discussion trop vite.
Il faudrait que je fasse des tests de mon côté.
-
je tâcherais de faire des test de mon côté, je ne te promet rien par contre

-
Je viens de relire le post et du-coup je viens de réaliser à quel point j’étais hors sujet x)
Je suis en train de faire des tests de mon côté, j’éditerai ce message en fonction des résultats.EDIT : impossible de trouver un équivalent pour autosavePeriod.
Et je me mange un NPE lorsque je lances le jeu :[22:56:43] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: –-- Minecraft Crash Report ---- // Ouch. That hurt :( Time: 02/10/15 22:56 Description: Initializing game java.lang.NullPointerException: Initializing game at net.minecraft.client.Minecraft.launchIntegratedServer(Minecraft.java:2198) at fr.minecraftforgefrance.test.CustomMainMenu.initGui(CustomMainMenu.java:150) at net.minecraft.client.gui.GuiScreen.setWorldAndResolution(GuiScreen.java:294) at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:865) at fr.minecraftforgefrance.test.TestMod.onGuiInit(TestMod.java:26) at cpw.mods.fml.common.eventhandler.ASMEventHandler_6_TestMod_onGuiInit_Post.invoke(.dynamic) at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138) at net.minecraft.client.gui.GuiScreen.setWorldAndResolution(GuiScreen.java:296) at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:865) 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(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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 net.minecraft.client.Minecraft.launchIntegratedServer(Minecraft.java:2198) at fr.minecraftforgefrance.test.CustomMainMenu.initGui(CustomMainMenu.java:150) at net.minecraft.client.gui.GuiScreen.setWorldAndResolution(GuiScreen.java:294) at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:865) at fr.minecraftforgefrance.test.TestMod.onGuiInit(TestMod.java:26) at cpw.mods.fml.common.eventhandler.ASMEventHandler_6_TestMod_onGuiInit_Post.invoke(.dynamic) at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:54) at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:138) at net.minecraft.client.gui.GuiScreen.setWorldAndResolution(GuiScreen.java:296) at net.minecraft.client.Minecraft.displayGuiScreen(Minecraft.java:865) 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(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) 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_60, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 937671696 bytes (894 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.1492 5 mods loaded, 5 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.1492-1.7.10.jar) UCHIJA Forge{10.13.4.1492} [Minecraft Forge] (forgeSrc-1.7.10-10.13.4.1492-1.7.10.jar) UCHIJA test{0.0.0} [Test] (bin) UCHIJA modtutoriel{1.0.0} [Mod Tutoriel] (bin) GL info: ' Vendor: 'NVIDIA Corporation' Version: '3.3.0' Renderer: 'GeForce 9600 GT/PCIe/SSE2' Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: GeForce 9600 GT/PCIe/SSE2 GL version 3.3.0, 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: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1) [22:56:43] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:398]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\robin\Documents\Modding\forge-1.7.10\eclipse\.\crash-reports\crash-2015-10-02_22.56.43-client.txt AL lib: (EE) alc_cleanup: 1 device not closedTu as la même chose de ton côté ?
-
Enfait ce menu là c’est un peu une usine a gaz, car il fait juste que lancer un serveur(une save quoi) qui il bloque le joueur et fait tourner sa caméra, pour affichier ensuite des boutons du menu principal, ce qui est un moyen de facilité je trouve, le mieux serait de faire un rendu 3D de blocs un peu comme mon tuto sur les menu 3D (a adapter donc pour les blocs) tu aura un résultat tellement plus propre…
Un peu comme le défunt Evil-Minecraft

A toi de jouer !

-
Peut être ZeAma, mais je souhaite vraiment avoir l équivalent. Déjà au niveau de la vue du joueur qui change et permet d avoir une vue globale des alentours mais aussi au niveau d une vue continuelle. Ta solution de rendu n est pas animé ? C est juste un rendu fixe, moi je veux que sa soit animé :3
Et si tu dis que mon code est une solution de facilité, pourquoi ne pas s en contenter alors ^^ ?
robin je vois ça tout l’heure
-
Bah oui tu peux utiliser cette solution ,j’t’empêche pas de faire ce que tu veux, mais après lancer un serveur juste pour un menu c’est pas top
Fait comme tu veux. -
Ok, je recommence le code de A à Z et de manière beaucoup plus propre, cette après-midi. Je vous tiens au courant

EDIT = Alors je suis en train de réimporter toutes les méthodes de chargement de monde, etc…Qui datent de la 1.8.1 car le système actuel ne marche pas (voir le NPE de robin). Du coup voici à quoi ressemble ma classe pour le moment avec quelque méthode réimportées de la béta. Je suis en train de tout corriger, je galère vraiment --’
@SideOnly(Side.CLIENT) public class CustomMainMenu extends GuiScreen implements GuiYesNoCallback { private int panoramaTimer; private DynamicTexture viewportTexture; private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[] {new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")}; private ResourceLocation field_110351_G; private short musicCounter = 0; private byte isFirstTime = 0; public static boolean mmactive = false; private List saveList; private int selectedWorld; public void updateScreen() { super.updateScreen(); } /** * Returns true if this GUI should pause the game when it is displayed in single-player */ public boolean doesGuiPauseGame() { return false; } public void initGui() { this.isFirstTime+=1; if(isFirstTime == 1) { Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147673_a(new ResourceLocation(DyingCraftMod.MODID + ":mainMenuTheme"))); } this.viewportTexture = new DynamicTexture(256, 256); this.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture); boolean flag = true; int i = this.height / 4 + 48; this.buttonList.add(new GuiButton(0, this.width / 2 - 100, i + 72 + 12, 98, 20, I18n.format("menu.options", new Object[0]))); this.buttonList.add(new GuiButton(4, this.width / 2 + 2, i + 72 + 12, 98, 20, I18n.format("menu.quit", new Object[0]))); this.buttonList.add(new GuiButton(1, this.width / 2 - 100, i, I18n.format("menu.singleplayer", new Object[0]))); mmactive = true; // if(musicId == -1 && !loadingWorld) // { // mc.sndManager.playSoundFX("lotr.music.menu", 0.1F, 1.0F); // try // { // musicId = Integer.valueOf(((Integer)ModLoader.getPrivateValue(net.minecraft.src.SoundManager.class, mc.sndManager, "e")).intValue()).intValue(); // ModLoader.setPrivateValue(net.minecraft.src.SoundManager.class, mc.sndManager, "i", Integer.valueOf(0x3b9ac9ff)); // } // catch(Exception exception) // { // if(exception instanceof NoSuchFieldException) // { // try // { // musicId = Integer.valueOf(((Integer)ModLoader.getPrivateValue(net.minecraft.src.SoundManager.class, mc.sndManager, "latestSoundID")).intValue()).intValue(); // ModLoader.setPrivateValue(net.minecraft.src.SoundManager.class, mc.sndManager, "ticksBeforeMusic", Integer.valueOf(0x3b9ac9ff)); // } // catch(Exception exception1) // { // exception1.printStackTrace(); // } // } else // { // exception.printStackTrace(); // } // } // } Minecraft.getMinecraft().gameSettings.hideGUI = true; Minecraft.getMinecraft().gameSettings.thirdPersonView = 1; //mc.playerController = new PlayerControllerSP(mc); if(mc.theWorld == null) { loadSaves(); String s = getSaveFileName(0); String s1 = getSaveName(0); if(s1 == null || s == null) { System.out.println("la map est nulle, il faut en créer une automatiquement"); } else { final long demoWorldSeed = (long)"North Carolina".hashCode(); final WorldSettings demoWorldSettings = (new WorldSettings(demoWorldSeed, WorldSettings.GameType.SURVIVAL, true, false, WorldType.DEFAULT)); this.startWorld(s, s1, new WorldSettings(0L, 0, false)); //this.mc.launchIntegratedServer(s, s1, demoWorldSettings); //mc.theWorld.autosavePeriod = 0x3b9ac9ff; } } } public void startWorld(String s, String s1, WorldSettings worldsettings) { changeWorld1(null); System.gc(); if(mc.getSaveLoader().isOldMapFormat(s)) { this.convertMapFormat(s, s1); } else { if(mc.loadingScreen != null) { mc.loadingScreen.resetProgressAndMessage("Switching level"); mc.loadingScreen.func_73722_d(""); } ISaveHandler isavehandler = mc.getSaveLoader().getSaveLoader(s, false); World world = null; //world = new World(isavehandler, s1, worldsettings); if(world.getWorldInfo() == null) { // mc.thePlayer.getStatFileWriter().readStat(StatList.createWorldStat, 1); // mc.thePlayer.getStatFileWriter().readStat(StatList.startGameStat, 1); changeWorld2(world, "Generating level"); } else { // mc.thePlayer.getStatFileWriter().readStat(StatList.loadWorldStat, 1); // mc.thePlayer.getStatFileWriter().readStat(StatList.startGameStat, 1); changeWorld2(world, "Loading level"); } } } private void convertMapFormat(String s, String s1) { mc.loadingScreen.resetProgressAndMessage((new StringBuilder()).append("Converting World to ").append(mc.getSaveLoader().func_154333_a()).toString()); mc.loadingScreen.func_73722_d("This may take a while :)"); mc.getSaveLoader().convertMapFormat(s, mc.loadingScreen); startWorld(s, s1, new WorldSettings(0L, 0, true)); } public void changeWorld1(World world) { changeWorld2(world, ""); } public void changeWorld2(World world, String s) { changeWorld(world, s, null); } public void changeWorld(World world, String s, EntityPlayer entityplayer) { statFileWriter.func_27175_b(); statFileWriter.syncStats(); renderViewEntity = null; if(loadingScreen != null) { loadingScreen.printText(s); loadingScreen.displayLoadingString(""); } sndManager.playStreaming(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F); if(theWorld != null) { theWorld.saveWorldIndirectly(loadingScreen); } theWorld = world; if(world != null) { if(playerController != null) { playerController.func_717_a(world); } if(!isMultiplayerWorld()) { if(entityplayer == null) { thePlayer = (EntityPlayerSP)world.func_4085_a(net.minecraft.src.EntityPlayerSP.class); } } else if(thePlayer != null) { thePlayer.preparePlayerToSpawn(); if(world != null) { world.entityJoinedWorld(thePlayer); } } if(!world.multiplayerWorld) { preloadWorld(s); } if(thePlayer == null) { thePlayer = (EntityPlayerSP)playerController.createPlayer(world); thePlayer.preparePlayerToSpawn(); playerController.flipPlayer(thePlayer); } thePlayer.movementInput = new MovementInputFromOptions(gameSettings); if(renderGlobal != null) { renderGlobal.changeWorld(world); } if(effectRenderer != null) { effectRenderer.clearEffects(world); } playerController.func_6473_b(thePlayer); if(entityplayer != null) { world.emptyMethod1(); } net.minecraft.src.IChunkProvider ichunkprovider = world.getIChunkProvider(); if(ichunkprovider instanceof ChunkProviderLoadOrGenerate) { ChunkProviderLoadOrGenerate chunkproviderloadorgenerate = (ChunkProviderLoadOrGenerate)ichunkprovider; int i = MathHelper.floor_float((int)thePlayer.posX) >> 4; int j = MathHelper.floor_float((int)thePlayer.posZ) >> 4; chunkproviderloadorgenerate.setCurrentChunkOver(i, j); } world.spawnPlayerWithLoadedChunks(thePlayer); if(world.isNewWorld) { world.saveWorldIndirectly(loadingScreen); } renderViewEntity = thePlayer; } else { thePlayer = null; } System.gc(); systemTime = 0L; } protected String getSaveName(int i) { if(saveList.size() < i + 1) { return null; } String s = ((SaveFormatComparator)saveList.get(i)).getDisplayName(); if(s == null || MathHelper.stringNullOrLengthZero(s)) { s = (new StringBuilder()).append(I18n.format("selectWorld.world")).append(" ").append(i + 1).toString(); } return s; } private void loadSaves() { ISaveFormat isaveformat = mc.getSaveLoader(); try { saveList = isaveformat.getSaveList(); } catch (AnvilConverterException e) { e.printStackTrace(); } Collections.sort(saveList); selectedWorld = -1; } protected String getSaveFileName(int i) { if(saveList.size() < i + 1) { return null; } else { return ((SaveFormatComparator)saveList.get(i)).getFileName(); } } protected void actionPerformed(GuiButton p_146284_1_) { if (p_146284_1_.id == 0) { this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); } if (p_146284_1_.id == 1) { this.mc.displayGuiScreen(new GuiSelectWorld(this)); } if (p_146284_1_.id == 4) { this.mc.shutdown(); } if (p_146284_1_.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); } } } private void drawPanorama(int p_73970_1_, int p_73970_2_, float p_73970_3_) { Tessellator tessellator = Tessellator.instance; GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPushMatrix(); GL11.glLoadIdentity(); Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glPushMatrix(); GL11.glLoadIdentity(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(90.0F, 0.0F, 0.0F, 1.0F); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); OpenGlHelper.glBlendFunc(770, 771, 1, 0); byte b0 = 8; for (int k = 0; k < b0 * b0; ++k) { GL11.glPushMatrix(); float f1 = ((float)(k % b0) / (float)b0 - 0.5F) / 64.0F; float f2 = ((float)(k / b0) / (float)b0 - 0.5F) / 64.0F; float f3 = 0.0F; GL11.glTranslatef(f1, f2, f3); GL11.glRotatef(MathHelper.sin(((float)this.panoramaTimer + p_73970_3_) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-((float)this.panoramaTimer + p_73970_3_) * 0.1F, 0.0F, 1.0F, 0.0F); for (int l = 0; l < 6; ++l) { GL11.glPushMatrix(); if (l == 1) { GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); } if (l == 2) { GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); } if (l == 3) { GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); } if (l == 4) { GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); } if (l == 5) { GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); } this.mc.getTextureManager().bindTexture(titlePanoramaPaths[l]); tessellator.startDrawingQuads(); tessellator.setColorRGBA_I(16777215, 255 / (k + 1)); float f4 = 0.0F; tessellator.addVertexWithUV(-1.0D, -1.0D, 1.0D, (double)(0.0F + f4), (double)(0.0F + f4)); tessellator.addVertexWithUV(1.0D, -1.0D, 1.0D, (double)(1.0F - f4), (double)(0.0F + f4)); tessellator.addVertexWithUV(1.0D, 1.0D, 1.0D, (double)(1.0F - f4), (double)(1.0F - f4)); tessellator.addVertexWithUV(-1.0D, 1.0D, 1.0D, (double)(0.0F + f4), (double)(1.0F - f4)); tessellator.draw(); GL11.glPopMatrix(); } GL11.glPopMatrix(); GL11.glColorMask(true, true, true, false); } tessellator.setTranslation(0.0D, 0.0D, 0.0D); GL11.glColorMask(true, true, true, true); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPopMatrix(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glPopMatrix(); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_DEPTH_TEST); } private void rotateAndBlurSkybox(float p_73968_1_) { this.mc.getTextureManager().bindTexture(this.field_110351_G); 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); GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); GL11.glColorMask(true, true, true, false); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); GL11.glDisable(GL11.GL_ALPHA_TEST); byte b0 = 3; for (int i = 0; i < b0; ++i) { tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float)(i + 1)); int j = this.width; int k = this.height; float f1 = (float)(i - b0 / 2) / 256.0F; tessellator.addVertexWithUV((double)j, (double)k, (double)this.zLevel, (double)(0.0F + f1), 1.0D); tessellator.addVertexWithUV((double)j, 0.0D, (double)this.zLevel, (double)(1.0F + f1), 1.0D); tessellator.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(1.0F + f1), 0.0D); tessellator.addVertexWithUV(0.0D, (double)k, (double)this.zLevel, (double)(0.0F + f1), 0.0D); } tessellator.draw(); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glColorMask(true, true, true, true); } /** * Renders the skybox in the main menu */ private void renderSkybox(int p_73971_1_, int p_73971_2_, float p_73971_3_) { this.mc.getFramebuffer().unbindFramebuffer(); GL11.glViewport(0, 0, 256, 256); this.drawPanorama(p_73971_1_, p_73971_2_, p_73971_3_); this.rotateAndBlurSkybox(p_73971_3_); this.rotateAndBlurSkybox(p_73971_3_); this.rotateAndBlurSkybox(p_73971_3_); this.rotateAndBlurSkybox(p_73971_3_); this.rotateAndBlurSkybox(p_73971_3_); this.rotateAndBlurSkybox(p_73971_3_); this.rotateAndBlurSkybox(p_73971_3_); this.mc.getFramebuffer().bindFramebuffer(true); GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); float f1 = this.width > this.height ? 120.0F / (float)this.width : 120.0F / (float)this.height; float f2 = (float)this.height * f1 / 256.0F; float f3 = (float)this.width * f1 / 256.0F; tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); int k = this.width; int l = this.height; tessellator.addVertexWithUV(0.0D, (double)l, (double)this.zLevel, (double)(0.5F - f2), (double)(0.5F + f3)); tessellator.addVertexWithUV((double)k, (double)l, (double)this.zLevel, (double)(0.5F - f2), (double)(0.5F - f3)); tessellator.addVertexWithUV((double)k, 0.0D, (double)this.zLevel, (double)(0.5F + f2), (double)(0.5F - f3)); tessellator.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(0.5F + f2), (double)(0.5F + f3)); 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_) { this.musicCounter++; if(musicCounter >= 1280) { musicCounter = 0; } if(musicCounter == 0) { Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147673_a(new ResourceLocation(DyingCraftMod.MODID + ":mainMenuTheme"))); } GL11.glDisable(GL11.GL_ALPHA_TEST); this.renderSkybox(p_73863_1_, p_73863_2_, p_73863_3_); GL11.glEnable(GL11.GL_ALPHA_TEST); Tessellator tessellator = Tessellator.instance; short short1 = 274; int k = this.width / 2 - short1 / 2; byte b0 = 30; tessellator.setColorOpaque_I(-1); super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); } }Si quelqu’un a une meilleure idée, je prends direct car je dois avouer que c’est vraiment chiant de corriger toutes ces erreurs sans savoir pour autant si ça marchera ><