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

    Solved Render d'un player comme si il est ligoté/menotté.

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

      Hello, alors voila, j’ai cherché a modifié le Player pou faire en sorte qu’il sois menotté/ligoté, sauf que je n’arrive pas a jouté la corde ou les menote,s j’arrive bien a lui mettre les main par derrière mais pas a mettre les menottes sans qu’il est l’item en main 😕

      Voici mon code : 
          PlayerModelRender :

      package fr.ph1823.mylife.entity;
      
      import api.player.model.ModelPlayerAPI;
      import api.player.model.ModelPlayerBase;
      import cpw.mods.fml.client.FMLClientHandler;
      import cpw.mods.fml.relauncher.Side;
      import cpw.mods.fml.relauncher.SideOnly;
      import fr.ph1823.mylife.Gui.ingame.Guimenotes;
      import fr.ph1823.mylife.MyLife;
      import net.minecraft.client.model.ModelBiped;
      import net.minecraft.client.model.ModelRenderer;
      import net.minecraft.entity.Entity;
      import net.minecraft.entity.EntityLivingBase;
      import net.minecraft.item.ItemArmor;
      import net.minecraft.item.ItemStack;
      
      /**
      * Created by Dupouy on 24/06/2017.
      */
      public class MyModModelPlayerBase extends ModelPlayerBase
      {
      
                     public MyModModelPlayerBase(ModelPlayerAPI modelplayerapi)
                 {
      
                     super(modelplayerapi);
      
                 }
      
         public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5,Entity e)
               {
      
                   super.setRotationAngles(f, f1, f2, f3, f4, f5,e);
                 //  ModelRenderer bipedTest= new Guimenotes(modelPlayer,"a");
               //    bipedTest.addBox(-3.0F, -2.0F, -2.0F, 4, 12, 4);
      
               //    bipedTest.render(0.5f);
                 //    modelPlayer.bipedRightArm.addChild(bipedTest);
                   modelPlayer. bipedRightArm.rotateAngleZ =15f;
                   //modelPlayer.bipedLeftArm.rotateAngleZ = -Quarter - Eighth - MathHelper.cos( 0.1F)  * 0.8F;
      
                   modelPlayer. bipedRightArm.rotateAngleX = -10f ;
                 //  modelPlayer. bipedLeftArm.rotateAngleX = (0.5F + Half % Whole - Half) * Sixteenth ;
      
               }
      
      }
      

      et pour tenté d’affiché les menottes :

      package fr.ph1823.mylife.Gui.ingame;
      
      import cpw.mods.fml.client.FMLClientHandler;
      import fr.ph1823.mylife.MyLife;
      import iCraft.core.utils.ICraftClientUtils;
      import net.minecraft.client.Minecraft;
      import net.minecraft.client.gui.Gui;
      import net.minecraft.client.gui.ScaledResolution;
      import net.minecraft.client.model.ModelBase;
      import net.minecraft.client.model.ModelRenderer;
      import net.minecraft.client.renderer.Tessellator;
      import net.minecraft.util.ResourceLocation;
      import org.lwjgl.opengl.GL11;
      
      /**
      * Created by ph1823 on 17/03/2017.
      */
      public class Guimenotes extends ModelRenderer {
         private static final ResourceLocation men = new ResourceLocation("plants:textures/items/menottes.png");
      
         public Guimenotes(ModelBase p_i1172_1_, String p_i1172_2_) {
             super(p_i1172_1_, p_i1172_2_);
      
             Minecraft minecraft = FMLClientHandler.instance().getClient();
             GL11.glDepthMask(true);
             GL11.glEnable(GL11.GL_DEPTH_TEST);
             GL11.glEnable(GL11.GL_ALPHA_TEST);
             GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
      
             ScaledResolution scaledresolution1 = new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight);
             int k = scaledresolution1.getScaledWidth();
             int l = scaledresolution1.getScaledHeight();
      
             ScaledResolution scaledresolution = new ScaledResolution(minecraft, 30,30);
             int i = scaledresolution.getScaledWidth();
             int j = scaledresolution.getScaledHeight();
      
             GL11.glEnable(GL11.GL_BLEND);
             GL11.glDisable(GL11.GL_DEPTH_TEST);
             GL11.glDepthMask(false);
             GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
             GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
             GL11.glDisable(GL11.GL_ALPHA_TEST);
             minecraft.getTextureManager().bindTexture(men);
             Tessellator tessellator = Tessellator.instance;
             tessellator.startDrawingQuads();
      
             tessellator.addVertexWithUV(k/2 ,j+l/4, -90D, 0.0D, 1.0D);
             tessellator.addVertexWithUV(i+k/2, j+l/4, -90D, 1.0D, 1.0D);
             tessellator.addVertexWithUV(i+k/2, l/4, -90D, 1.0D, 0.0D);
             tessellator.addVertexWithUV(k/2, l/4, -90D, 0.0D, 0.0D);
      
             tessellator.draw();
             GL11.glDepthMask(true);
             GL11.glEnable(GL11.GL_DEPTH_TEST);
             GL11.glEnable(GL11.GL_ALPHA_TEST);
             GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
             // GL11.glColor4f(0F, 0F, 0F, 1F);
      
             //drawTexturedModalRect(i / 2 - 91, j - 22, 0, 0, 182, 22);
      
             //drawString(s, 100, 100, 8453920);
         }
        /* public Guimenotes(Minecraft minecraft) {
      
         }*/
      }
      
      

      Voila merci de votre aide, j’espère que j’ai assez détaillé mon problème !

      Cordialement, le membre ayant le pseudo "ph1823"

      Ma chaîne YouTube: https://www.youtube.com/c/ph1823
      Mon Twitter : https://twitter.com/ph1823
      Des jeux vidéo moin chers? Alors check ici : http://bit.ly/instaceph ou ici : http://bit.ly/g2aph

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

        Salut,
        ta classe Guimenotte est incohérente puisqu’il y a un mélange de 2d (drawTexturedModalRect) et de 3d (classe fille de ModelRenderer), sans parler de l’allure du code contenu dans son premier constructeur…
        Non, je te recommanderai de rendre tes menottes dans une classe CustomRender, héritant de RenderPlayerBase, de Model Player API, dans la méthode overrided renderPlayer, plutôt que de le faire dans ta classe MyModModelPlayerBase.

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

        MINECRAFT FORGE FRANCE © 2018

        Powered by NodeBB