MFF

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

    Get la texture d'un joueur

    Planifier Épinglé Verrouillé Déplacé Résolu Anciennes versions
    1.6.4
    12 Messages 2 Publieurs 4.6k 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.
    • robin4002R Hors-ligne
      robin4002 Moddeurs confirmés Rédacteurs Administrateurs
      dernière édition par

      Normal, tu essayes de lire directement un fichier distant.
      Il faut download la texture.
      Regardes le code du rendu de la tête de joueur.

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

        RenderPlayer ?


        Je comptais me serveur du tutoriel pour les capes sur votre serveur mais il existe plus ?

        Si je t'ai filé un coup de main n'oublie pas le + / -
        Par contre évite les demandes d'aides en MP, tu sera sympa'

        La JavaDoc c'est comme le PQ, ça sert à ce démerder tous seul. -Victor Hugo- 2017

        Une superbe API pour animer vos super modèles CraftStudio dans Minecraft !

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

          net.minecraft.client.renderer.tileentity.TileEntitySkullRenderer
          En 1.7.10 il faut comme ça, mais en 1.6.4 c’est différent :

          ResourceLocation resourcelocation = AbstractClientPlayer.locationStevePng;
          
          if (p_152674_7_ != null)
          {
          Minecraft minecraft = Minecraft.getMinecraft();
          Map map = minecraft.func_152342_ad().func_152788_a(p_152674_7_);
          
          if (map.containsKey(Type.SKIN))
          {
          resourcelocation = minecraft.func_152342_ad().func_152792_a((MinecraftProfileTexture)map.get(Type.SKIN), Type.SKIN);
          }
          }
          
          this.bindTexture(resourcelocation);
          

          Le tutoriel sur les capes a été supprimé car Mojang interdit de faire de capes customs, même si c’est pas pour être vendu.

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

            Ah ok pour les capes et je vais tester cette fonction du coup on verra bien


            J’arrive à afficher le steve mais pas le skin du joueur

            Mes codes

            ResourceLocation resourcelocation = AbstractClientPlayer.locationStevePng;
            
            

            et

            if (string != null && string.length() > 0)
            {
            resourcelocation = AbstractClientPlayer.getLocationSkull(string);
            AbstractClientPlayer.getDownloadImageSkin(resourcelocation, string);
            }
            
            this.mc.renderEngine.bindTexture(resourcelocation);
            

            Si je t'ai filé un coup de main n'oublie pas le + / -
            Par contre évite les demandes d'aides en MP, tu sera sympa'

            La JavaDoc c'est comme le PQ, ça sert à ce démerder tous seul. -Victor Hugo- 2017

            Une superbe API pour animer vos super modèles CraftStudio dans Minecraft !

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

              Tu peux envoyer tout le code ?

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

                Voilà le code complet

                :::

                package viruz.zeamateis.gui.minecraft;
                
                import java.awt.Cursor;
                import java.awt.Desktop;
                import java.awt.Menu;
                import java.awt.Window;
                import java.io.BufferedReader;
                import java.io.InputStreamReader;
                import java.net.URL;
                import java.util.Calendar;
                import java.util.Date;
                import java.util.Map;
                import java.util.Random;
                import java.util.logging.Level;
                import java.util.logging.Logger;
                
                import net.minecraft.client.Minecraft;
                import net.minecraft.client.entity.AbstractClientPlayer;
                import net.minecraft.client.gui.GuiButton;
                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.ScaledResolution;
                import net.minecraft.client.main.Main;
                import net.minecraft.client.model.ModelSkeletonHead;
                import net.minecraft.client.multiplayer.LanServerList;
                import net.minecraft.client.multiplayer.ServerData;
                import net.minecraft.client.multiplayer.ThreadLanServerFind;
                import net.minecraft.client.renderer.OpenGlHelper;
                import net.minecraft.client.renderer.RenderHelper;
                import net.minecraft.client.renderer.Tessellator;
                import net.minecraft.client.renderer.entity.RenderManager;
                import net.minecraft.client.renderer.texture.DynamicTexture;
                import net.minecraft.client.resources.I18n;
                import net.minecraft.entity.EntityLivingBase;
                import net.minecraft.util.EnumChatFormatting;
                import net.minecraft.util.MathHelper;
                import net.minecraft.util.ResourceLocation;
                
                import org.lwjgl.opengl.GL11;
                import org.lwjgl.opengl.GL12;
                import org.lwjgl.util.glu.Project;
                
                import viruz.zeamateis.miscellaneous.Accentuation;
                import viruz.zeamateis.model.ModelFakePlayer;
                import viruz.zeamateis.model.mob.ModelCrawler;
                import cpw.mods.fml.client.FMLClientHandler;
                import cpw.mods.fml.relauncher.Side;
                import cpw.mods.fml.relauncher.SideOnly;
                
                @SideOnly(Side.CLIENT)
                public class GuiMainMenuViruZ extends GuiScreen
                {
                /** The RNG used by the Main Menu Screen. */
                private static final Random rand = new Random();
                
                /** Counts the number of screen updates. */
                private float updateCounter;
                
                /** 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 boolean field_96141_q = true;
                private static boolean field_96140_r;
                private static boolean field_96139_s;
                private final Object field_104025_t = new Object();
                private String field_92025_p;
                private String field_104024_v;
                private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("viruz:title/vzlogo.png");
                
                /** An array of all the paths to the panorama pictures. */
                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 String text = readFile("http://viruz.fr/ViruZ/Launcher%201.6/News/ViruZ.txt");
                private int textPosition;
                
                /** The 'Direct Connect' button was clicked */
                private boolean directClicked;
                
                /** Instance of ServerData. */
                private ServerData theServerData;
                private LanServerList localNetworkServerList;
                private ThreadLanServerFind localServerFindThread;
                
                private GuiButton buttonONOFF;
                
                private static ModelFakePlayer fakePlayer = new ModelFakePlayer();
                private static final ResourceLocation playerSkin = new ResourceLocation("");
                ResourceLocation resourcelocation = AbstractClientPlayer.locationStevePng;
                private String string;
                private float field_74209_t;
                private float field_74208_u;
                private float rotation;
                private float speedRotation = 0.5F;
                
                private static String newsComponent()
                {
                Calendar calendar = Calendar.getInstance();
                calendar.setTime(new Date());
                
                String news = "";
                
                if(calendar.get(2) + 1 == 8 && calendar.get(5) >= 1 && calendar.get(5) <= 31)
                {
                news = EnumChatFormatting.GOLD + "(New !)";
                }
                return news;
                }
                
                private static String readFile(String url)
                {
                String text = "";
                try
                {
                URL location = new URL(url);
                BufferedReader in = new BufferedReader(new InputStreamReader(location.openStream()));
                text = in.readLine();
                }
                catch (Exception e)
                {
                System.out.println(e);
                }
                return text;
                }
                
                public GuiMainMenuViruZ()
                {
                this.updateCounter = rand.nextFloat();
                }
                
                /**
                * Called from the main game loop to update the screen.
                */
                public void updateScreen()
                {
                ++this.panoramaTimer;
                
                if (textPosition < 0 - mc.fontRenderer.getStringWidth(text))
                {
                textPosition = width / 2 + 220;
                }
                
                textPosition -= 2;
                }
                
                /**
                * 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 par1, int par2) {}
                
                /**
                * 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.text = "Bon anniversaire, ez !";
                }
                else if (calendar.get(2) + 1 == 6 && calendar.get(5) == 1)
                {
                this.text = "Bon anniversaire, Notch !";
                }
                else if (calendar.get(2) + 1 == 12 && calendar.get(5) == 24)
                {
                this.text = "Joyeux No" + Accentuation.E_Tremat +"l !";
                }
                else if (calendar.get(2) + 1 == 1 && calendar.get(5) == 1)
                {
                this.text = "Bonne ann" + Accentuation.E_Aigu + "e !";
                }
                else if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31)
                {
                this.text = EnumChatFormatting.DARK_RED + "Viru" + EnumChatFormatting.DARK_GREEN + "Z " + EnumChatFormatting.WHITE + Accentuation.A_Grave + " 1 an !";
                }
                else if (calendar.get(2) + 1 == 4 && calendar.get(5) == 5)
                {
                this.text = "Bon anniversaire, ZeAmateis !";
                }
                else if (calendar.get(2) + 1 == 9 && calendar.get(5) == 3)
                {
                this.text = "Bon anniversaire, Tiarnan !";
                }
                
                boolean flag = true;
                int i = this.height / 4 + 48;
                
                this.addViruZButtons(i, 24);
                
                }
                
                private void addViruZButtons(int par1, int par2)
                {
                Calendar calendar = Calendar.getInstance();
                calendar.setTime(new Date());
                
                int i = this.height / 4 + 48;
                
                this.buttonList.add(new GuiButton(0, this.width / 2 - 100, i + 72 + 12, 98, 20, I18n.getString("menu.options")));
                this.buttonList.add(new GuiButton(1, this.width / 2 - 100, i - 25 + 12, 150, 20, I18n.getString("Serveur PVE/PVP")));
                
                /*if(this.mc.getSession().getUsername().equals("TheAmateis") || this.mc.getSession().getUsername().equals("IcyFlurry") || this.mc.getSession().getUsername().equals("hugolc"))
                {*/
                this.buttonList.add(new GuiButton(2, this.width / 2 - 25, 110 + 12, 50, 20, I18n.getString("Solo")));
                //}
                
                this.buttonList.add(new GuiButton(3, this.width / 2 + 2, i + 49 + 12, 98, 20, I18n.getString(EnumChatFormatting.DARK_RED + "Viru" + EnumChatFormatting.DARK_GREEN + "Z" + EnumChatFormatting.WHITE + ".fr")));
                this.buttonList.add(new GuiButton(4, this.width / 2 - 100, i + 49 + 12, 98, 20, I18n.getString(EnumChatFormatting.DARK_RED + "Foru" + EnumChatFormatting.DARK_GREEN + "m")));
                this.buttonList.add(new GuiButton(5, this.width / 2 - 100, i + 25 + 12, 98, 20, I18n.getString(EnumChatFormatting.WHITE + "Wiki" + EnumChatFormatting.DARK_GREEN + "Z")));
                
                this.buttonList.add(new GuiButton(7, this.width / 2 + 2, i + 72 + 12, 98, 20, I18n.getString("menu.quit")));
                
                this.buttonList.add(new GuiButton(9, this.width / 2 + 2, i + 25 + 12, 98, 20, I18n.getString("Cr" + Accentuation.E_Aigu + "dits " + newsComponent())));
                }
                
                /**
                * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e).
                */
                protected void actionPerformed(GuiButton par1GuiButton)
                {
                if (par1GuiButton.id == 0)
                {
                this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
                }
                
                if (par1GuiButton.id == 1)
                {
                /*if(this.mc.getSession().getUsername().equals("TheAmateis"))
                {*/
                this.mc.displayGuiScreen(new GuiMultiplayer(this));
                /* }
                else
                {
                this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, "pve.viruz.fr", 33200));
                }*/
                }
                
                if (par1GuiButton.id == 2)
                {
                this.mc.displayGuiScreen(new GuiSelectWorld(this));
                }
                
                if (par1GuiButton.id == 3)
                {
                {
                
                Desktop desktop = null;
                java.net.URI url;
                try {
                url = new java.net.URI("http://viruz.fr");
                if (Desktop.isDesktopSupported())
                {
                desktop = Desktop.getDesktop();
                desktop.browse(url);
                }
                }
                catch (Exception ex) {
                Logger.getLogger(Menu.class.getName()).log(Level.SEVERE, null, ex);
                }
                }
                }
                if (par1GuiButton.id == 4)
                {
                {
                
                Desktop desktop = null;
                java.net.URI url;
                try {
                url = new java.net.URI("http://viruz.fr/forum/");
                if (Desktop.isDesktopSupported())
                {
                desktop = Desktop.getDesktop();
                desktop.browse(url);
                }
                }
                catch (Exception ex) {
                Logger.getLogger(Menu.class.getName()).log(Level.SEVERE, null, ex);
                }
                }
                }
                if (par1GuiButton.id == 5)
                {
                {
                Desktop desktop = null;
                java.net.URI url;
                try {
                url = new java.net.URI("http://viruz.fr/forum/viewforum.php?f=18");
                if (Desktop.isDesktopSupported())
                {
                desktop = Desktop.getDesktop();
                desktop.browse(url);
                }
                }
                catch (Exception ex) {
                Logger.getLogger(Menu.class.getName()).log(Level.SEVERE, null, ex);
                }
                }
                }
                
                if (par1GuiButton.id == 7)
                {
                this.mc.shutdown();
                }
                
                if (par1GuiButton.id == 9)
                {
                this.mc.displayGuiScreen(new GuiCredits(this));
                }
                
                }
                
                /**
                * Draws the main menu panorama
                */
                private void drawPanorama(int par1, int par2, float par3)
                {
                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.glEnable(GL11.GL_BLEND);
                GL11.glDisable(GL11.GL_ALPHA_TEST);
                GL11.glDisable(GL11.GL_CULL_FACE);
                GL11.glDepthMask(false);
                GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
                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 + par3) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F);
                GL11.glRotatef(-((float)this.panoramaTimer + par3) * 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_ALPHA_TEST);
                GL11.glEnable(GL11.GL_DEPTH_TEST);
                }
                
                /**
                * Rotate and blurs the skybox view in the main menu
                */
                private void rotateAndBlurSkybox(float par1)
                {
                this.mc.getTextureManager().bindTexture(this.field_110351_G);
                GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
                GL11.glEnable(GL11.GL_BLEND);
                GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
                GL11.glColorMask(true, true, true, false);
                Tessellator tessellator = Tessellator.instance;
                tessellator.startDrawingQuads();
                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), 0.0D);
                tessellator.addVertexWithUV((double)j, 0.0D, (double)this.zLevel, (double)(1.0F + f1), 0.0D);
                tessellator.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(1.0F + f1), 1.0D);
                tessellator.addVertexWithUV(0.0D, (double)k, (double)this.zLevel, (double)(0.0F + f1), 1.0D);
                }
                
                tessellator.draw();
                GL11.glColorMask(true, true, true, true);
                }
                
                /**
                * Renders the skybox in the main menu
                */
                private void renderSkybox(int par1, int par2, float par3)
                {
                GL11.glViewport(0, 0, 256, 256);
                this.drawPanorama(par1, par2, par3);
                GL11.glDisable(GL11.GL_TEXTURE_2D);
                GL11.glEnable(GL11.GL_TEXTURE_2D);
                this.rotateAndBlurSkybox(par3);
                this.rotateAndBlurSkybox(par3);
                this.rotateAndBlurSkybox(par3);
                this.rotateAndBlurSkybox(par3);
                this.rotateAndBlurSkybox(par3);
                this.rotateAndBlurSkybox(par3);
                this.rotateAndBlurSkybox(par3);
                this.rotateAndBlurSkybox(par3);
                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;
                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.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();
                }
                
                public void fakePlayer(int par1, int par2, float par3)
                {
                GL11.glPushMatrix();
                GL11.glScalef(1.0F, 1.0F, 1.0F);
                GL11.glColor3f(1.0F, 1.0F, 1.0F);
                drawFakePlayer(par1, par2, par3);
                GL11.glPopMatrix();
                }
                
                public void drawFakePlayer(int par0, int par1, float par2)
                {
                this.rotation += speedRotation;
                if(this.rotation > 360)
                {
                this.rotation = 0;
                }
                
                GL11.glPushMatrix();
                GL11.glMatrixMode(5889);
                GL11.glPushMatrix();
                GL11.glLoadIdentity();
                
                ScaledResolution scaledresolution = new ScaledResolution(this.mc.gameSettings, 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.45F, -0.1F, 0.0F);
                
                GL11.glScalef(0.66F, 0.85F, 0.66F);
                Project.gluPerspective(90.599998F, 1.333333F, 9.0F, 180.0F);
                float f1 = 1.0F;
                GL11.glMatrixMode(5888);
                GL11.glLoadIdentity();
                RenderHelper.enableStandardItemLighting();
                GL11.glTranslatef(0.0F, -3.6F, -16.0F);
                GL11.glScalef(f1, f1, f1);
                float f2 = 5.0F;
                GL11.glScalef(4.0F, 4.0F, 4.0F);
                GL11.glRotatef(20.0F, -1.0F, 0.0F, 0.0F);
                if (string != null && string.length() > 0)
                {
                resourcelocation = AbstractClientPlayer.getLocationSkull(string);
                AbstractClientPlayer.getDownloadImageSkin(resourcelocation, string);
                }
                
                this.mc.renderEngine.bindTexture(resourcelocation);
                //this.mc.getTextureManager().bindTexture(playerSkin);
                GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
                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);
                GL11.glScalef(1.1F, 1.1F, 0.5F);
                GL11.glRotatef(this.rotation, 0.0F, 1.0F, 0.0F);
                GL11.glRotatef(-(1.0F - f3) * 90.0F - 90.0F, 0.0F, 1.0F, 0.0F);
                GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
                /*float f4 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * par1 + 0.25F;
                float f5 = this.field_74212_q + (this.field_74213_p - this.field_74212_q) * par1 + 0.75F;
                f4 = (f4 - MathHelper.truncateDoubleToInt(f4)) * 1.6F - 0.3F;
                f5 = (f5 - MathHelper.truncateDoubleToInt(f5)) * 1.6F - 0.3F;
                
                if(f4 < 0.0F)
                {
                f4 = 0.0F;
                }
                
                if(f5 < 0.0F)
                {
                f5 = 0.0F;
                }
                
                if(f4 > 1.0F)
                {
                f4 = 1.0F;
                }
                
                if(f5 > 1.0F)
                {
                f5 = 1.0F;
                }*/
                
                GL11.glEnable(32826);
                fakePlayer.render(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();
                RenderHelper.disableStandardItemLighting();
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
                }
                
                /**
                * Draws the screen and all the components in it.
                */
                public void drawScreen(int par1, int par2, float par3)
                {
                this.renderSkybox(par1, par2, par3);
                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);
                }
                
                //String SRV = "Vous avez lu les C.G.U " + EnumChatFormatting.RED + mc.getSession().getUsername() + EnumChatFormatting.WHITE + " ?";
                String VZ = EnumChatFormatting.DARK_RED + "Viru" + EnumChatFormatting.DARK_GREEN + "Z";
                String ZE = "ZeAmateis - Copyright Mojang AB";
                
                this.drawString(this.fontRenderer, ZE, this.width - this.fontRenderer.getStringWidth(ZE) - 2, this.height - 10, 16777215);
                this.drawString(this.fontRenderer, VZ, 2, this.height - ( 1 * (this.fontRenderer.FONT_HEIGHT + 1)), 16777215);
                //this.drawString(this.fontRenderer, SRV, this.width - this.fontRenderer.getStringWidth(SRV) - 2, this.height - 22, 16777215);
                
                drawRect(0, 0, width, 12, 0x66000000);
                this.drawString(this.fontRenderer, text, this.textPosition, 2, 16777215);
                
                this.fakePlayer(par1, par2, par3);
                
                super.drawScreen(par1, par2, par3);
                }
                
                static Minecraft func_110348_a(GuiMainMenuViruZ par0GuiMainMenu)
                {
                return par0GuiMainMenu.mc;
                }
                
                static boolean func_110349_a(boolean par0)
                {
                field_96139_s = par0;
                return par0;
                }
                
                static Minecraft func_130018_c(GuiMainMenuViruZ par0GuiMainMenu)
                {
                return par0GuiMainMenu.mc;
                }
                
                static Minecraft func_130019_d(GuiMainMenuViruZ par0GuiMainMenu)
                {
                return par0GuiMainMenu.mc;
                }
                }
                

                :::

                Si je t'ai filé un coup de main n'oublie pas le + / -
                Par contre évite les demandes d'aides en MP, tu sera sympa'

                La JavaDoc c'est comme le PQ, ça sert à ce démerder tous seul. -Victor Hugo- 2017

                Une superbe API pour animer vos super modèles CraftStudio dans Minecraft !

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

                  Ta variable string est null, donc

                  if (string != null && string.length() > 0)
                  {
                  resourcelocation = AbstractClientPlayer.getLocationSkull(string);
                  AbstractClientPlayer.getDownloadImageSkin(resourcelocation, string);
                  }
                  

                  n’est jamais exécuté.

                  string devrait valoir le pseudo du joueur.

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

                    Donc j’ai fait quelque chose comme ça:

                    ResourceLocation resourcelocation = AbstractClientPlayer.locationStevePng;
                    private String string = FMLClientHandler.instance().getClient().getSession().getUsername();
                    

                    et

                    if (string != null && string.length() > 0)
                    {
                    resourcelocation = AbstractClientPlayer.getLocationSkull(string);
                    AbstractClientPlayer.getDownloadImageSkin(resourcelocation, string);
                    }
                    
                    

                    Mais toujours le skin du petit mexicain, je pense que je me suis trompé quelque part

                    Si je t'ai filé un coup de main n'oublie pas le + / -
                    Par contre évite les demandes d'aides en MP, tu sera sympa'

                    La JavaDoc c'est comme le PQ, ça sert à ce démerder tous seul. -Victor Hugo- 2017

                    Une superbe API pour animer vos super modèles CraftStudio dans Minecraft !

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

                      Je viens de vérifier, je ne vois pas pourquoi ça ne fonctionne pas.
                      Peut être le jeu n’a pas le temps de télécharger le skin.

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

                        J’ai rien dans la console qui stipule qu’il télécharge le skin, je vais test un outprint


                        J’ai fait un outprint en dessous de

                        AbstractClientPlayer.getDownloadImageSkin(resourcelocation, string);
                        

                        et le message ce répète en boucle donc il dois le télécharger non ?


                        Ah non j’ai fait le c** j’avais zapper le –username= dans les config de lancement ! ça marche !

                        Si je t'ai filé un coup de main n'oublie pas le + / -
                        Par contre évite les demandes d'aides en MP, tu sera sympa'

                        La JavaDoc c'est comme le PQ, ça sert à ce démerder tous seul. -Victor Hugo- 2017

                        Une superbe API pour animer vos super modèles CraftStudio dans Minecraft !

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

                          Bravo x)

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

                          MINECRAFT FORGE FRANCE © 2024

                          Powered by NodeBB