MFF

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

    Questions : CustomMenu + Bug touche

    Planifier Épinglé Verrouillé Déplacé Résolu 1.7.x
    1.7.10
    55 Messages 4 Publieurs 12.8k Vues 1 Watching
    Charger plus de messages
    • Du plus ancien au plus récent
    • Du plus récent au plus ancien
    • Les plus votés
    Répondre
    • Répondre à l'aide d'un nouveau sujet
    Se connecter pour répondre
    Ce sujet a été supprimé. Seuls les utilisateurs avec les droits d'administration peuvent le voir.
    • Benjamin LoisonB Hors-ligne
      Benjamin Loison
      dernière édition par

      Le message étant trop long je l’ai mis sur un pastbin : http://pastebin.com/VHy3wZMf

      >! Développeur de Altis-Life (Arma III) sur Minecraft !
      >! Site web     : https://lemnoslife.com

      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

        Les proxy ne sont pas les mêmes, donc ce n’est pas ça. build le mod et regarde s’il y a le même problème.

        1 réponse Dernière réponse Répondre Citer 0
        • Benjamin LoisonB Hors-ligne
          Benjamin Loison
          dernière édition par

          Toujours le même problème… 😞

          >! Développeur de Altis-Life (Arma III) sur Minecraft !
          >! Site web     : https://lemnoslife.com

          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

            Même après avoir build le mod et testé sur Minecraft ?

            1 réponse Dernière réponse Répondre Citer 0
            • Benjamin LoisonB Hors-ligne
              Benjamin Loison
              dernière édition par

              Oui 😢

              >! Développeur de Altis-Life (Arma III) sur Minecraft !
              >! Site web     : https://lemnoslife.com

              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

                Envoie le code concerné.

                1 réponse Dernière réponse Répondre Citer 0
                • Benjamin LoisonB Hors-ligne
                  Benjamin Loison
                  dernière édition par

                  ​package fr.altiscraft.altiscraft.proxy;
                  
                  import net.minecraft.client.Minecraft;
                  import net.minecraft.client.model.ModelBiped;
                  import net.minecraft.client.settings.KeyBinding;
                  import net.minecraft.util.ResourceLocation;
                  import net.minecraft.util.StringUtils;
                  import cpw.mods.fml.client.registry.ClientRegistry;
                  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 fr.altiscraft.altiscraft.common.EntityMobBenjaminLoison;
                  import fr.altiscraft.altiscraft.common.RenderMobBenjaminLoison;
                  import fr.altiscraft.altiscraft.common.TileEntityATM;
                  import fr.altiscraft.altiscraft.common.TileEntityCoco;
                  import fr.altiscraft.altiscraft.common.TileEntityLampadaire;
                  import fr.altiscraft.altiscraft.common.TileEntityVLampadaire;
                  
                  public class ClientProxy extends CommonProxy {
                  public static int tesrRenderId;
                  
                  @Override
                  public void registerRender() {
                  FMLCommonHandler.instance().bus().register(this);
                  System.out.println("Méthode côté client");
                  RenderingRegistry.registerEntityRenderingHandler(
                  EntityMobBenjaminLoison.class, new RenderMobBenjaminLoison(
                  new ModelBiped()));
                  
                  ClientRegistry.bindTileEntitySpecialRenderer(TileEntityATM.class,
                  new TileEntityATMSpecialRenderer());
                  ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCoco.class,
                  new TileEntityCocoSpecialRenderer());
                  ClientRegistry.bindTileEntitySpecialRenderer(
                  TileEntityLampadaire.class,
                  new TileEntityLampadaireSpecialRenderer());
                  ClientRegistry.bindTileEntitySpecialRenderer(
                  TileEntityVLampadaire.class,
                  new TileEntityVLampadaireSpecialRenderer());
                  tesrRenderId = RenderingRegistry.getNextAvailableRenderId();
                  RenderingRegistry.registerBlockHandler(new TESRInventoryRenderer());
                  }
                  
                  private static KeyBinding keyBindTest;
                  
                  {
                  keyBindTest = new KeyBinding("altiscraft.inventaire", 21,
                  "key.categories.inventory");
                  ClientRegistry.registerKeyBinding(keyBindTest);
                  }
                  
                  @SubscribeEvent
                  public void onEvent(KeyInputEvent event) {
                  
                  if (keyBindTest.isPressed()) {
                  keyTestTyped();
                  }
                  }
                  
                  private void keyTestTyped() {
                  Minecraft.getMinecraft().thePlayer
                  .sendChatMessage((new StringBuilder()).append("/inventaire")
                  .toString());
                  Minecraft.getMinecraft();
                  }
                  
                  public static ResourceLocation getLocationSkin(String Skin) {
                  return new ResourceLocation("skins/"
                  + StringUtils.stripControlCodes(Skin));
                  }
                  }
                  

                  >! Développeur de Altis-Life (Arma III) sur Minecraft !
                  >! Site web     : https://lemnoslife.com

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

                    C’est censé être quoi là ?

                    private static KeyBinding keyBindTest;
                    
                    {
                    keyBindTest = new KeyBinding("altiscraft.inventaire", 21,
                    "key.categories.inventory");
                    ClientRegistry.registerKeyBinding(keyBindTest);
                    }
                    

                    Une méthode ? Une variable ?

                    Site web contenant mes scripts : http://SCAREXgaming.github.io

                    Pas de demandes de support par MP ni par skype SVP.
                    Je n'accepte sur skype que l…

                    1 réponse Dernière réponse Répondre Citer 0
                    • Benjamin LoisonB Hors-ligne
                      Benjamin Loison
                      dernière édition par

                      Une méthode normalement.

                      >! Développeur de Altis-Life (Arma III) sur Minecraft !
                      >! Site web     : https://lemnoslife.com

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

                        Ce n’est pas une méthode car tu as mis un “;” à la fin donc le code entre crochets est compté comme étant au tout début de ta classe, comme des variables.

                        Pour le rendu : il est à l’envers par rapport à quoi ?

                        Site web contenant mes scripts : http://SCAREXgaming.github.io

                        Pas de demandes de support par MP ni par skype SVP.
                        Je n'accepte sur skype que l…

                        1 réponse Dernière réponse Répondre Citer 0
                        • Benjamin LoisonB Hors-ligne
                          Benjamin Loison
                          dernière édition par

                          Comment faire alors pour régler et voilà les classes de mon VLampadaire qui s’affiche que dans l’inventaire à l’envers (vertical) :

                          ​package fr.altiscraft.altiscraft.common;
                          
                          import net.minecraft.block.Block;
                          import net.minecraft.block.material.Material;
                          import net.minecraft.entity.EntityLivingBase;
                          import net.minecraft.item.ItemStack;
                          import net.minecraft.tileentity.TileEntity;
                          import net.minecraft.util.MathHelper;
                          import net.minecraft.world.IBlockAccess;
                          import net.minecraft.world.World;
                          import net.minecraftforge.common.util.ForgeDirection;
                          import fr.altiscraft.altiscraft.proxy.ClientProxy;
                          
                          public class BlocVLampadaire extends Block
                          {
                          
                          protected BlocVLampadaire()
                          {
                          super(Material.ground);
                          }
                          
                          @Override
                          public boolean hasTileEntity(int metadata)
                          {
                          return true;
                          }
                          
                          @Override
                          public TileEntity createTileEntity(World world, int metadata)
                          {
                          return new TileEntityVLampadaire();
                          }
                          
                          public boolean isOpaqueCube()
                              {
                                  return false;
                              }
                          
                              public boolean renderAsNormalBlock()
                              {
                                  return false;
                              }
                          
                              public int getRenderType()
                              {
                                  return ClientProxy.tesrRenderId;
                              }
                              public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase living, ItemStack stack)
                              {
                                  if(stack.getItemDamage() == 0)
                                  {
                                      TileEntity tile = world.getTileEntity(x, y, z);
                                      if(tile instanceof TileEntityVLampadaire)
                                      {
                                          int direction = MathHelper.floor_double((double)(living.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
                                          ((TileEntityVLampadaire)tile).setDirection((byte)direction);
                                      }
                                  }
                              }
                          
                              @Override
                              public boolean rotateBlock(World world, int x, int y, int z, ForgeDirection axis)
                              {
                                  if((axis == ForgeDirection.UP || axis == ForgeDirection.DOWN) && !world.isRemote && world.getBlockMetadata(x, y, z) == 0)
                                  {
                                      TileEntity tile = world.getTileEntity(x, y, z);
                                      if(tile instanceof TileEntityVLampadaire)
                                      {
                                          TileEntityVLampadaire tileVLampadaire = (TileEntityVLampadaire)tile;
                                          byte direction = tileVLampadaire.getDirection();
                                          direction++;
                                          if(direction > 3)
                                          {
                                              direction = 0;
                                          }
                                          tileVLampadaire.setDirection(direction);
                                          return true;
                                      }
                                  }
                                  return false;
                              }
                          
                              public ForgeDirection[] getValidRotations(World world, int x, int y, int z)
                              {
                                  return world.getBlockMetadata(x, y, z) == 0 ? new ForgeDirection[] {ForgeDirection.UP, ForgeDirection.DOWN} : ForgeDirection.VALID_DIRECTIONS;
                              }
                          public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y,
                          int z) {
                          this.setBlockBounds(0.40F, 0.0F, 0.40F, 0.60F, 2.5F, 0.60F);
                          }
                              }
                          
                          
                          ​package fr.altiscraft.altiscraft.common;
                          
                          import net.minecraft.nbt.NBTTagCompound;
                          import net.minecraft.network.NetworkManager;
                          import net.minecraft.network.Packet;
                          import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
                          import net.minecraft.tileentity.TileEntity;
                          
                          public class TileEntityVLampadaire extends TileEntity
                          {
                              private byte direction;
                          
                              @Override
                              public void readFromNBT(NBTTagCompound compound)
                              {
                                  super.readFromNBT(compound);
                                  this.direction = compound.getByte("Direction");
                              }
                          
                              @Override
                              public void writeToNBT(NBTTagCompound compound)
                              {
                                  super.writeToNBT(compound);
                                  compound.setByte("Direction", this.direction);
                              }
                          
                              public byte getDirection()
                              {
                                  return direction;
                              }
                          
                              public void setDirection(byte direction)
                              {
                                  this.direction = direction;
                                  this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
                              }
                          
                              public Packet getDescriptionPacket()
                              {
                                  NBTTagCompound nbttagcompound = new NBTTagCompound();
                                  this.writeToNBT(nbttagcompound);
                                  return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbttagcompound);
                              }
                          
                              public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt)
                              {
                                  this.readFromNBT(pkt.func_148857_g());
                                  this.worldObj.markBlockRangeForRenderUpdate(this.xCoord, this.yCoord, this.zCoord, this.xCoord, this.yCoord, this.zCoord);
                              }
                          }
                          
                          ​package fr.altiscraft.altiscraft.proxy;
                          
                          import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
                          import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
                          import net.minecraft.tileentity.TileEntity;
                          import net.minecraft.util.ResourceLocation;
                          
                          import org.lwjgl.opengl.GL11;
                          
                          import fr.altiscraft.altiscraft.client.ModelBlockVLampadaire;
                          import fr.altiscraft.altiscraft.common.ModAltisCraft;
                          import fr.altiscraft.altiscraft.common.TileEntityVLampadaire;
                          
                          public class TileEntityVLampadaireSpecialRenderer extends TileEntitySpecialRenderer{
                          public static ModelBlockVLampadaire modelv = new ModelBlockVLampadaire();
                          public static ResourceLocation texturev = new ResourceLocation(ModAltisCraft.MODID, "textures/models/blocks/ModelBlockVLampadaire.png");
                          
                          public TileEntityVLampadaireSpecialRenderer()
                          {
                          this.func_147497_a(TileEntityRendererDispatcher.instance);
                          }
                          
                          @Override
                          public void renderTileEntityAt(TileEntity tile, double x,
                          double y, double z, float partialRenderTick) {
                              this.renderTileEntityVLampadaireAt((TileEntityVLampadaire) tile, x, y, z, partialRenderTick);
                          }
                          
                          private void renderTileEntityVLampadaireAt(TileEntityVLampadaire tile, double x, double y,
                          double z, float partialRenderTick) {
                          GL11.glPushMatrix();
                                  GL11.glTranslated(x + 0.5D, y + 1.5D, z + 0.5D);
                                  GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
                                  GL11.glRotatef((90F * tile.getDirection()) + 180F, 0.0F, 1.0F, 0.0F);
                                  this.bindTexture(texturev);
                                  modelv.renderAll();
                                  GL11.glPopMatrix();
                          }
                          }
                          
                          
                          ​package fr.altiscraft.altiscraft.proxy;
                          
                          import net.minecraft.block.Block;
                          import net.minecraft.client.Minecraft;
                          import net.minecraft.client.renderer.RenderBlocks;
                          import net.minecraft.world.IBlockAccess;
                          
                          import org.lwjgl.opengl.GL11;
                          
                          import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
                          import fr.altiscraft.altiscraft.common.ModAltisCraft;
                          
                          public class TESRInventoryRenderer implements ISimpleBlockRenderingHandler {
                          
                          @Override
                          public void renderInventoryBlock(Block block, int metadata, int modelId,
                          RenderBlocks renderer) {
                          if (block == ModAltisCraft.BlocATM) {
                          GL11.glPushMatrix();
                          GL11.glRotatef(270.0F, 0.0F, 1.0F, 0.0F);
                          GL11.glTranslatef(0.0F, -1.0F, 0.0F);
                          Minecraft.getMinecraft().getTextureManager()
                          .bindTexture(TileEntityATMSpecialRenderer.texture);
                          TileEntityATMSpecialRenderer.model.renderAll();
                          GL11.glPopMatrix();
                          }
                          
                          else if (block == ModAltisCraft.BlocVLampadaire) {
                          GL11.glPushMatrix();
                          GL11.glRotatef(270.0F, 0.0F, 1.0F, 0.0F);
                          GL11.glTranslatef(0.0F, -1.0F, 0.0F);
                          Minecraft.getMinecraft().getTextureManager()
                          .bindTexture(TileEntityVLampadaireSpecialRenderer.texturev);
                          TileEntityVLampadaireSpecialRenderer.modelv.renderAll();
                          GL11.glPopMatrix();
                          }
                          
                          else if (block == ModAltisCraft.BlocCoco) {
                          GL11.glPushMatrix();
                          GL11.glRotatef(270.0F, 0.0F, 1.0F, 0.0F);
                          GL11.glTranslatef(0.0F, -1.0F, 0.0F);
                          Minecraft.getMinecraft().getTextureManager()
                          .bindTexture(TileEntityCocoSpecialRenderer.textures);
                          TileEntityCocoSpecialRenderer.models.renderAll();
                          GL11.glPopMatrix();
                          }
                          
                          else if (block == ModAltisCraft.BlocLampadaire) {
                          GL11.glPushMatrix();
                          GL11.glRotatef(270.0F, 0.0F, 1.0F, 0.0F);
                          GL11.glTranslatef(0.0F, -1.0F, 0.0F);
                          Minecraft.getMinecraft().getTextureManager()
                          .bindTexture(TileEntityCocoSpecialRenderer.texturesb);
                          TileEntityCocoSpecialRenderer.modelsb.renderAll();
                          GL11.glPopMatrix();
                          }
                          }
                          
                          @Override
                          public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z,
                          Block block, int modelId, RenderBlocks renderer) {
                          return false;
                          }
                          
                          @Override
                          public int getRenderId() {
                          return ClientProxy.tesrRenderId;
                          }
                          
                          @Override
                          public boolean shouldRender3DInInventory(int modelId) {
                          return true;
                          }
                          }
                          
                          

                          >! Développeur de Altis-Life (Arma III) sur Minecraft !
                          >! Site web     : https://lemnoslife.com

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

                            Retire cette ligne : GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); dans la classe TileEntityVLampadaireSpecialRenderer ligne 35.

                            Site web contenant mes scripts : http://SCAREXgaming.github.io

                            Pas de demandes de support par MP ni par skype SVP.
                            Je n'accepte sur skype que l…

                            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

                              Au contraire cette ligne met le modèle dans le bon sens. C’est dans le rendu dans l’inventaire qu’il doit ajouter celle ligne.

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

                                Ah oui, je croyais que c’était dans le monde le problème.

                                Site web contenant mes scripts : http://SCAREXgaming.github.io

                                Pas de demandes de support par MP ni par skype SVP.
                                Je n'accepte sur skype que l…

                                1 réponse Dernière réponse Répondre Citer 0
                                • Benjamin LoisonB Hors-ligne
                                  Benjamin Loison
                                  dernière édition par

                                  C’est bon merci énormément et pour mon problème de touche alors ? 🙂 Et mon Menu ^^ et encore merci ❤

                                  >! Développeur de Altis-Life (Arma III) sur Minecraft !
                                  >! Site web     : https://lemnoslife.com

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

                                    à la place de ceci :

                                    private static KeyBinding keyBindTest;
                                    
                                    {
                                    keyBindTest = new KeyBinding("altiscraft.inventaire", 21,
                                    "key.categories.inventory");
                                    ClientRegistry.registerKeyBinding(keyBindTest);
                                    }
                                    

                                    Mets private static KeyBinding keyBindTest = new KeyBinding(“altiscraft.inventaire”, 21, “key.categories.inventory”);
                                    et ClientRegistry.registerKeyBinding(keyBindingTest); dans la fonction registerRender.

                                    Site web contenant mes scripts : http://SCAREXgaming.github.io

                                    Pas de demandes de support par MP ni par skype SVP.
                                    Je n'accepte sur skype que l…

                                    1 réponse Dernière réponse Répondre Citer 0
                                    • Benjamin LoisonB Hors-ligne
                                      Benjamin Loison
                                      dernière édition par

                                      et c’est ClientRegistry.registerKeyBinding(keyBindTest); ^^ merci énormément pour tout et le menu alors ? 🙂 et je vois qu’il s’affiche maintenant que 2x :S

                                      >! Développeur de Altis-Life (Arma III) sur Minecraft !
                                      >! Site web     : https://lemnoslife.com

                                      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

                                        Menu :

                                           @SubscribeEvent
                                           public void onGuiInit(GuiScreenEvent.InitGuiEvent.Pre event)
                                           {
                                               if(event.gui.getClass().equals(GuiMainMenu.class))
                                               {
                                                   this.mc.displayGuiScreen(new TonMenu());
                                               }
                                           }
                                        
                                        1 réponse Dernière réponse Répondre Citer 0
                                        • TheAzkazeT Hors-ligne
                                          TheAzkaze
                                          dernière édition par

                                          Si tu mes

                                          private final ResourceLocation backGround = new ResourceLocation("modtutoriel", "textures/gui/menu.png");
                                          

                                          deja il faut suprimer

                                          private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png");
                                          
                                          

                                          En dessous de

                                          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);
                                          }
                                          }
                                          
                                          

                                          Ajoute

                                          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();
                                          }
                                          

                                          et suprime

                                          private void renderBackGround() {
                                          // TODO Auto-generated method stub
                                          
                                          }
                                          
                                          
                                          1 réponse Dernière réponse Répondre Citer 0
                                          • Benjamin LoisonB Hors-ligne
                                            Benjamin Loison
                                            dernière édition par

                                            C’est quoi déjà à la place de mc ? ligne 6 ?

                                            >! Développeur de Altis-Life (Arma III) sur Minecraft !
                                            >! Site web     : https://lemnoslife.com

                                            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