Problème Invetory + Item comme une map



  • Hello, je reivent sur mon problème d'avis de recherche, voici ma classe:

    [font=Courier Newpackage ]fr.ph1823.MyLife.Item%(#cc7832)[;
    ]
    import fr.ph1823.MyLife.GloryRP%(#cc7832)[;
    ]import net.minecraft.entity.player.EntityPlayer%(#cc7832)[;
    ]import net.minecraft.item.Item%(#cc7832)[;
    ]import net.minecraft.item.ItemStack%(#cc7832)[;
    ]import net.minecraft.world.World%(#cc7832)[;
    ]
    public class Search extends Item{
      public Search()  {
         setUnlocalizedName("Search")%(#cc7832)[;
    ]      setTextureName("plants:a")%(#cc7832)[;
    ]      setCreativeTab(GloryRP.*plantTab*)%(#cc7832)[;
    ]      setMaxStackSize(1)%(#cc7832)[;
    ]   }
      %(#629755)[*/**
    *]%(#629755)[*    * Used to open the gui
    *]%(#629755)[*    */
    *]   %(#bbb529)[@Override
    ]   public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
         player.openGui(GloryRP.*instance*, 0, world, (int) player.posX, (int) player.posY, (int) player.posZ)%(#cc7832)[;
    ]      return stack%(#cc7832)[;
    ]   }
    
    }
    

    La classe de l'inventaire :

    [font=Courier Newpackage ]fr.ph1823.MyLife.Gui.Amandes%(#cc7832)[;
    ]
    %(#629755)[*/**
    *]%(#629755)[* * Created by ph1823 - Minecraft on 29/02/2016.
    *]%(#629755)[* */
    *]
    import com.mojang.authlib.GameProfile%(#cc7832)[;
    ]import cpw.mods.fml.client.FMLClientHandler%(#cc7832)[;
    ]import cpw.mods.fml.server.FMLServerHandler%(#cc7832)[;
    ]import fr.ph1823.MyLife.GloryRP%(#cc7832)[;
    ]import fr.ph1823.MyLife.Gui.Amandes.inv.InventoryBackPack%(#cc7832)[;
    ]import fr.ph1823.MyLife.Item.Search%(#cc7832)[;
    ]import net.minecraft.client.gui.*%(#cc7832)[;
    ]import net.minecraft.client.gui.inventory.GuiContainer%(#cc7832)[;
    ]import net.minecraft.client.resources.I18n%(#cc7832)[;
    ]import net.minecraft.entity.player.EntityPlayer%(#cc7832)[;
    ]import net.minecraft.entity.player.InventoryPlayer%(#cc7832)[;
    ]import net.minecraft.item.ItemStack%(#cc7832)[;
    ]import net.minecraft.nbt.NBTBase%(#cc7832)[;
    ]import net.minecraft.server.MinecraftServer%(#cc7832)[;
    ]import net.minecraft.util.IChatComponent%(#cc7832)[;
    ]import net.minecraft.util.ResourceLocation%(#cc7832)[;
    ]
    import org.lwjgl.Sys%(#cc7832)[;
    ]import org.lwjgl.input.Keyboard%(#cc7832)[;
    ]import org.lwjgl.opengl.GL11%(#cc7832)[;
    ]import fr.ph1823.MyLife.Gui.Amandes.inv.container.*%(#cc7832)[;
    ]
    import java.awt.*%(#cc7832)[;
    ]import java.io.IOException%(#cc7832)[;
    ]import java.net.URI%(#cc7832)[;
    ]import java.util.ArrayList%(#cc7832)[;
    ]import java.util.List%(#cc7832)[;
    ]
    public class Amendes
    
    extends GuiContainer {
      private GuiTextField g%(#cc7832)[;
    ]
            public static final ResourceLocation *texture *= new ResourceLocation("guicustom","textures/a.png")%(#cc7832)[;
    ]        protected InventoryBackPack inv%(#cc7832)[;
    ]        protected InventoryPlayer playerInv%(#cc7832)[;
    ]        public int rows%(#cc7832)[;
    ]
            public Amendes(InventoryPlayer playerInv, InventoryBackPack inv) {
               super(new ContainerBackPack(playerInv, inv))%(#cc7832)[;
    ]            this.playerInv = playerInv%(#cc7832)[;
    ]            this.inv = inv%(#cc7832)[;
    ]            this.allowUserInput = %(#cc7832)[false;
    ]            %(#808080)[// Calculate the number of rows
    ]            this.rows = inv.getSizeInventory() / 9%(#cc7832)[;
    ]            %(#808080)[// Height of the GUI using the number of rows
    ]            this.ySize = 114 + this.rows * 18%(#cc7832)[;
    ]
           }
       protected List buttonList = new ArrayList()%(#cc7832)[;
    ]    %(#bbb529)[@Override
    ]    public void initGui() {
           super.initGui()%(#cc7832)[;
    ]        Keyboard.*enableRepeatEvents*(true)%(#cc7832)[;
    ]
        %(#808080)[//   FontRenderer f = this.mc.fontRenderer;
    ]        int i = (this.width - this.xSize) / 2%(#cc7832)[;
    ]        int j = (this.height - this.ySize) / 2%(#cc7832)[;
    ]
    
         %(#808080)[//  g = new GuiTextField(f, 55,230, 100,100);
    ]        this.g = new GuiTextField(this.fontRendererObj, i + 62, j + 24, 103, 12)%(#cc7832)[;
    ]        this.g.setTextColor(-1)%(#cc7832)[;
    ]        this.g.setDisabledTextColour(-1)%(#cc7832)[;
    ]        this.g.setEnableBackgroundDrawing(false)%(#cc7832)[;
    ]        this.g.setMaxStringLength(40)%(#cc7832)[;
    ]
    
           %(#808080)[//   g.drawTextBox();
    ]%(#808080)[        // this.buttonList.add(g);
    ]        this.buttonList.add(new GuiButton(32, this.width / 2 - 100, i+ 24, 200, 20, "Valide") {
               %(#bbb529)[@Override
    ]            public void mouseReleased(int x, int y) {
                   mc.currentScreen.confirmClicked(true, 1)%(#cc7832)[;
    ]                playerInv.closeInventory()%(#cc7832)[;
    ]                EntityPlayer p1 = playerInv.player%(#cc7832)[;
    ]                MinecraftServer mc1 = FMLServerHandler.*instance*().getServer()%(#cc7832)[;
    ]                for(GameProfile g1 : mc1.func_152357_F()) {
                       if(g.getText().equals(g1.getName())) {
                           EntityPlayer p = mc1.getEntityWorld().func_152378_a(g1.getId())%(#cc7832)[;
    ]                    %(#808080)[//    GuiRepair
    ]%(#808080)[                        //p.inventory.addItemStackToInventory(new ItemStack(GloryRP.MenotesItem,1));
    ]                    } else {
                           IChatComponent msg = IChatComponent.Serializer.*func_150699_a*("§4Erreur : la personne demandé n'existe pas.")%(#cc7832)[;
    ]
    
                           p1.addChatMessage(msg)%(#cc7832)[;
    ]                    }
                   }
    
               }
           })%(#cc7832)[;
    ]
    
       }
       %(#bbb529)[@Override
    ]    public void onGuiClosed()
       {
           super.onGuiClosed()%(#cc7832)[;
    ]        Keyboard.*enableRepeatEvents*(false)%(#cc7832)[;
    ]    }
       %(#bbb529)[@Override
    ]    protected void drawGuiContainerForegroundLayer(int x, int y) {
       %(#808080)[//super.drawGuiContainerForegroundLayer(x, y);
    ]
    
           GL11.*glDisable*(GL11.*GL_LIGHTING*)%(#cc7832)[;
    ]        GL11.*glDisable*(GL11.*GL_BLEND*)%(#cc7832)[;
    ]
           int k%(#cc7832)[;
    ]        for (k = 0; k < this.buttonList.size(); ++k) {
               ((GuiButton) this.buttonList.get(k)).drawButton(this.mc, x, y)%(#cc7832)[;
    ]        }
           GL11.*glEnable*(GL11.*GL_LIGHTING*)%(#cc7832)[;
    ]    }
          %(#808080)[/* @Override
    ]%(#808080)[        protected void drawGuiContainerForegroundLayer(int x, int y) {
    ]%(#808080)[            Keyboard.enableRepeatEvents(true);
    ]          //  this.fontRendererObj.drawString(I18n.format(this.inv.getInventoryName(), new Object[0), 8, 6, 4210752);
    ]
    %(#808080)[            int k;
    ]
    %(#808080)[            for (k = 0; k < this.buttonList.size(); ++k)
    ]%(#808080)[            {
    ]%(#808080)[                ((GuiButton)this.buttonList.get(k)).drawButton(this.mc, x, y);
    ]%(#808080)[            }
    ]
                // this.fontRendererObj.drawString(this.playerInv.hasCustomInventoryName() ? this.playerInv.getInventoryName() : I18n.format(this.playerInv.getInventoryName(), new Object[0), 8, this.ySize - 96 + 2, 4210752);
    ]%(#808080)[        }*/
    ]    %(#bbb529)[@Override
    ]    protected void actionPerformed(GuiButton button)
       {
    
           playerInv.closeInventory()%(#cc7832)[;
    ]
    
            %(#808080)[/*   this.mc.currentScreen.confirmClicked(true, 1);
    ]%(#808080)[            playerInv.closeInventory();
    ]%(#808080)[            EntityPlayer p1 = playerInv.player;
    ]%(#808080)[        p1.closeScreen();
    ]%(#808080)[        IChatComponent msg1 = IChatComponent.Serializer.func_150699_a("§4Erreur : la personne demandé n'existe pas. id : " + button.id);
    ]
    
    %(#808080)[        p1.addChatMessage(msg1);
    ]%(#808080)[            MinecraftServer mc1 = FMLServerHandler.instance().getServer();
    ]%(#808080)[            for (GameProfile g1 : mc1.func_152357_F()) {
    ]%(#808080)[                if (g.getText().equals(g1.getName())) {
    ]%(#808080)[                    EntityPlayer p = mc1.getEntityWorld().func_152378_a(g1.getId());
    ]%(#808080)[                    p.inventory.addItemStackToInventory(new ItemStack(GloryRP.MenotesItem, 1));
    ]%(#808080)[                } else {
    ]%(#808080)[                    IChatComponent msg = IChatComponent.Serializer.func_150699_a("§4Erreur : la personne demandé n'existe pas.");
    ]
    
    %(#808080)[                    p1.addChatMessage(msg);
    ]%(#808080)[                }
    ]%(#808080)[            }*/
    ]
    
       }
    
       protected void g1() {
           String s = this.g.getText()%(#cc7832)[;
    ]        System.*out*.print(s)%(#cc7832)[;
    ]    }
       %(#629755)[*/**
    *]%(#629755)[*     * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e).
    *]%(#629755)[*     */
    *]    %(#bbb529)[@Override
    ]    protected void keyTyped(char p_73869_1_, int p_73869_2_) {
    
           if (this.g.textboxKeyTyped(p_73869_1_, p_73869_2_))
           {
               this.g1()%(#cc7832)[;
    ]        }
           %(#cc7832)[else
    ]        {
               super.keyTyped(p_73869_1_, p_73869_2_)%(#cc7832)[;
    ]        }
    
            %(#808080)[//   this.field_146308_f.setFocused(!this.field_146308_f.isFocused());
    ]
       }
           %(#bbb529)[@Override
    ]        protected void drawGuiContainerBackgroundLayer(float prt, int x, int y) {
              %(#808080)[// super.drawGuiContainerBackgroundLayer();
    ]            GL11.*glColor4f*(1.0F, 1.0F, 1.0F, 1.0F)%(#cc7832)[;
    ]            this.mc.getTextureManager().bindTexture(*texture*)%(#cc7832)[;
    ]
               %(#808080)[// Centering GUI
    ]            int k = (this.width - this.xSize) / 2%(#cc7832)[;
    ]            int l = (this.height - this.ySize) / 2%(#cc7832)[;
    ]
               %(#808080)[// Drawing the first part of the GUI (slots of the backpack)
    ]            this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.rows * 18 + 17)%(#cc7832)[;
    ]            %(#808080)[// And after the slots from the player's inventory
    ]            this.drawTexturedModalRect(k, l + this.rows * 18 + 17, 0, 126, this.xSize, 96)%(#cc7832)[;
    ]        }
    
     %(#808080)[/*  @Override
    ]%(#808080)[    public void updateScreen()
    ]%(#808080)[    {
    ]%(#808080)[        super.updateScreen();
    ]%(#808080)[        g.updateCursorCounter();
    ]%(#808080)[    }*/
    ]
    
       %(#bbb529)[@Override
    ]    protected void mouseClicked(int mouseX, int mouseY, int mouseButton)
       {
           super.mouseClicked(mouseX, mouseY, mouseButton)%(#cc7832)[;
    ]        this.g.mouseClicked(mouseX, mouseY, mouseButton)%(#cc7832)[;
    ]
       }
    
       %(#bbb529)[@Override
    ]    public void drawScreen(int i, int j, float f)
       {
           super.drawScreen(i, j, f)%(#cc7832)[;
    ]        GL11.*glDisable*(GL11.*GL_LIGHTING*)%(#cc7832)[;
    ]        GL11.*glDisable*(GL11.*GL_BLEND*)%(#cc7832)[;
    ]        g.drawTextBox()%(#cc7832)[;
    ]
    
       }
    
    }
    

    Le common PROXY :

    [font=Courier Newpackage ]fr.ph1823.MyLife.Proxy%(#cc7832)[;
    ]
    import fr.ph1823.MyLife.Gui.Amandes.inv.*%(#cc7832)[;
    ]import fr.ph1823.MyLife.Gui.Amandes.inv.container.*%(#cc7832)[;
    ]import fr.ph1823.MyLife.Gui.Amandes.*%(#cc7832)[;
    ]import fr.ph1823.MyLife.Item.Menotes%(#cc7832)[;
    ]import fr.ph1823.MyLife.Item.Search%(#cc7832)[;
    ]import net.minecraft.entity.player.EntityPlayer%(#cc7832)[;
    ]import net.minecraft.world.World%(#cc7832)[;
    ]import cpw.mods.fml.common.network.IGuiHandler%(#cc7832)[;
    ]
    
    %(#629755)[*/**
    *]%(#629755)*   ***@author ***%(#629755)[*SCAREX
        *]%(#629755)[* *
        *]%(#629755)[* */
        *]public class CommonProxy implements IGuiHandler
        {
          %(#bbb529)[@Override
        ]   public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
             switch (ID) {
                case 0:
                   %(#808080)[// The last parameter must be a multiple of 9 (e.g: 9, 18, 27, 54)
        ]%(#808080)[            // Condition to check if the player has the right item in hand
        ]            if (player.getHeldItem() == null || !(player.getHeldItem().getItem() instanceof Search)) %(#cc7832)[return null;
        ]            return new ContainerBackPack(player.inventory, new InventoryBackPack(player.getHeldItem(), 54))%(#cc7832)[;
        ]      }
             %(#cc7832)[return null;
        ]   }
    
          %(#bbb529)[@Override
        ]   public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
             switch (ID) {
                case 0:
                   %(#808080)[// The last parameter must be a multiple of 9 (e.g: 9, 18, 27, 54)
        ]%(#808080)[            // Condition to check if the player has the right item in hand
        ]            if (player.getHeldItem() == null || !(player.getHeldItem().getItem() instanceof Search)) %(#cc7832)[return null;
        ]            return new Amendes(player.inventory, new InventoryBackPack(player.getHeldItem(), 54))%(#cc7832)[;
        ]      }
             %(#cc7832)[return null;
        ]   }
        }
    
        ```
        deux problème ce pose : le guitext n'est pas ajouté, et quand on click sur validé sans ne produit rien j'ai regardé dans GuiRepair et reproduit (casiment) la classe mais je crois que j'ai faut une ..
        Maintenant passont a l'item de type MAP, enfin c'est plus une carte d'identité que je veux faire voici ma classe, en commentaire la ou je suis bloqué :
        ```java
        [font=Courier Newpackage ]fr.ph1823.MyLife.Item%(#cc7832)[;
        ]
        import fr.ph1823.MyLife.GloryRP%(#cc7832)[;
        ]import net.minecraft.item.Item%(#cc7832)[;
        ]import net.minecraft.item.ItemMap%(#cc7832)[;
        ]import net.minecraft.item.ItemMapBase%(#cc7832)[;
        ]import net.minecraft.server.v1_7_R4.ItemWorldMap%(#cc7832)[;
        ]
        import java.util.Random%(#cc7832)[;
        ]
        public class Identity extends Item{
          public Identity()  {
             Random r = new Random()%(#cc7832)[;
        ]      String name = "UnNomAléa"%(#cc7832)[;
        ]      String surname = "UnPrénomAléa"%(#cc7832)[;
        ]   %(#808080)[// int age = r.ints(10, 50).sum();
        ]      int age = r.nextInt(50)%(#cc7832)[;
        ]      setUnlocalizedName("Card")%(#cc7832)[;
        ]      setTextureName("plants:card");
        [font=Courier New//Je bloque ici je ne sais pas comment mettre les info :/
        ]      %(#808080)[//getIconIndex(this).
        ]%(#808080)[      //this.setTextureName("").addInformation();
        ]      setCreativeTab(GloryRP.*plantTab*)%(#cc7832)[;
        ]      %(#808080)[//ItemWorldMap
        ]%(#808080)[      //ItemMap
        ]%(#808080)[      //ItemMapBase
        ]      setMaxStackSize(1)%(#cc7832)[;
        ]   }
    
        }
        ```
        Merci de votre aide, cordialement ph1823.




  • Merci, effectivement je suis stupide j'avais vue flase sur le GuiRepair '-' , et pour la carte, enfait ca cerais comme une MAP (en gros ca l'affiche dans la main) mais sous forme de carte d'identité mais je ne sais pas comme dessiné dessus enfin mettre les information


  • Administrateurs

    Salut,
    Pour ton premier problème, pourquoi tu utilise ton common proxy comme gui handler ?!?

    Pour l'item de map, la map utilise un code spécial pour le rendu qui est hardcodé, je ne suis pas sûr qu'il soit possible de le reproduire de manière simple.



  • Essaie soit d'ajouter un rendu spécial à ton item via l'interface IItemRenderer.
    Sinon rend le model de ta carte (crée sous techne) dans l'event RenderPlayerEvent, seulement si l'item tenu est égal à ta carte d'identité.



  • @'robin4002':

    Salut,
    Pour ton premier problème, pourquoi tu utilise ton common proxy comme gui handler ?!?

    Pour l'item de map, la map utilise un code spécial pour le rendu qui est hardcodé, je ne suis pas sûr qu'il soit possible de le reproduire de manière simple.

    Common proxy car je l'ai vue dsans un tuto, ce n'est pas cela?

    @'Plaigon':

    Essaie soit d'ajouter un rendu spécial à ton item via l'interface IItemRenderer.
    Sinon rend le model de ta carte (crée sous techne) dans l'event RenderPlayerEvent, seulement si l'item tenu est égal à ta carte d'identité.

    D'accord, merci voici ma classse en suivant ce tuto : http://www.minecraftforge.net/wiki/Custom_2D_Inventory_Item_Renderer
    :

    [font=Courier Newpackage ]fr.ph1823.MyLife.Item%(#cc7832)[;
    ]
    import fr.ph1823.MyLife.GloryRP%(#cc7832)[;
    ]import net.minecraft.client.Minecraft%(#cc7832)[;
    ]import net.minecraft.client.gui.FontRenderer%(#cc7832)[;
    ]import net.minecraft.client.renderer.Tessellator%(#cc7832)[;
    ]import net.minecraft.client.renderer.entity.RenderItem%(#cc7832)[;
    ]import net.minecraft.item.Item%(#cc7832)[;
    ]import net.minecraft.item.ItemStack%(#cc7832)[;
    ]import net.minecraftforge.client.IItemRenderer%(#cc7832)[;
    ]import net.minecraft.util.IIcon%(#cc7832)[;
    ]import org.lwjgl.opengl.GL11%(#cc7832)[;
    ]
    import java.util.Random%(#cc7832)[;
    ]
    public class Identity extends Item implements IItemRenderer {
      private static RenderItem *renderItem *= new RenderItem()%(#cc7832)[;
    ]   public Identity()  {
    
         Random r = new Random()%(#cc7832)[;
    ]      String name = "UnNomAléa"%(#cc7832)[;
    ]      String surname = "UnPrénomAléa"%(#cc7832)[;
    ]   %(#808080)[// int age = r.ints(10, 50).sum();
    ]      int age = r.nextInt(50)%(#cc7832)[;
    ]      setUnlocalizedName("Card")%(#cc7832)[;
    ]      setTextureName("plants:card")%(#cc7832)[;
    ]      %(#808080)[//getIconIndex(this).
    ]%(#808080)[      //this.setTextureName("").addInformation();
    ]      setCreativeTab(GloryRP.*plantTab*)%(#cc7832)[;
    ]      %(#808080)[//ItemWorldMap
    ]%(#808080)[      //ItemMap
    ]%(#808080)[      //ItemMapBase
    ]      setMaxStackSize(1)%(#cc7832)[;
    ]   }
    
         %(#bbb529)[@Override
    ]      public boolean handleRenderType(ItemStack item, ItemRenderType type) {
            type = ItemRenderType.*FIRST_PERSON_MAP*%(#cc7832)[;
    ]         %(#808080)[// Get icon index for the texture
    ]         net.minecraft.util.IIcon icon = item.getIconIndex()%(#cc7832)[;
    ]%(#808080)[// Use vanilla code to render the icon in a 16x16 square of inventory slot
    ]         *renderItem*.renderIcon(0, 0, icon, 16, 16)%(#cc7832)[;
    ]
            %(#808080)[//
    ]%(#808080)[// Set drawing mode (see first tutorial link above).
    ]         GL11.*glBegin*(GL11.*GL_QUADS*)%(#cc7832)[;
    ]%(#808080)[// Set semi-transparent black color
    ]         GL11.*glColor4f*(0F, 0F, 0F, 0.5F)%(#cc7832)[;
    ]
    %(#808080)[// Draw a 8x8 square
    ]         GL11.*glVertex3d*(0, 0, 0)%(#cc7832)[;
    ]         GL11.*glVertex3d*(0, 8, 0)%(#cc7832)[;
    ]         GL11.*glVertex3d*(8, 8, 0)%(#cc7832)[;
    ]         GL11.*glVertex3d*(8, 0, 0)%(#cc7832)[;
    ]
            GL11.*glEnd*()%(#cc7832)[;
    ]
            Tessellator tessellator = Tessellator.*instance*%(#cc7832)[;
    ]%(#808080)[// Set drawing mode. Tessellator should support most drawing modes.
    ]         tessellator.startDrawing(GL11.*GL_QUADS*)%(#cc7832)[;
    ]%(#808080)[// Set semi-transparent black color
    ]         tessellator.setColorRGBA(0, 0, 0, 128)%(#cc7832)[;
    ]
    %(#808080)[// Draw a 8x8 square
    ]         tessellator.addVertex(0, 0, 0)%(#cc7832)[;
    ]         tessellator.addVertex(0, 8, 0)%(#cc7832)[;
    ]         tessellator.addVertex(8, 8, 0)%(#cc7832)[;
    ]         tessellator.addVertex(8, 0, 0)%(#cc7832)[;
    ]
            tessellator.draw()%(#cc7832)[;
    ]         FontRenderer fontRenderer = Minecraft.*getMinecraft*().fontRenderer%(#cc7832)[;
    ]         %(#808080)[// Enable texturing, because Minecraft text font is actually a texture
    ]         GL11.*glEnable*(GL11.*GL_TEXTURE_2D*)%(#cc7832)[;
    ]%(#808080)[// Get our text value
    ]         String text = Integer.*toString*(item.getItemDamage())%(#cc7832)[;
    ]%(#808080)[// Draw our text at (1, 1) with white color
    ]         fontRenderer.drawStringWithShadow(text, 1, 1, 0xFFFFFF)%(#cc7832)[;
    ]
    
             return type == ItemRenderType.*INVENTORY*%(#cc7832)[;
    ]      }
    
         %(#bbb529)[@Override
    ]      public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
            %(#cc7832)[return false;
    ]      }
    
         %(#bbb529)[@Override
    ]      public void renderItem(ItemRenderType type, ItemStack item, Object… data) {
    
         }
    
    }
    

    [/java]
    est telle bonne ?


  • Administrateurs

    ça fonctionne aussi mais je trouves pas ça très propre.

    Pour l'IItemRenderer il faut faire une autre classe et non utiliser celle du bloc.



  • Oui, mais l'autre classe on devras la déclaré ou?



  • Qu'entends-tu par déclarer ?
    Pour l'utilisation de l'IItemRenderer, je te conseille ce tuto :
    http://www.minecraftforgefrance.fr/showthread.php?tid=130



  • Hey, désoler de revenir sur ce sujet, voila j'ai enfin compris (enfin je pense ^^) sauf que voila, au lieux de faire ce que je veux, cela ajoute un zéro en haut de l'écran et ca affiche un zéro dans l'inventaire quand on a l'item a la main ;( voici le code :

    [font=Courier Newpackage ]net.minecraft.client.gui%(#cc7832)[;
    ]
    import com.google.common.collect.Maps%(#cc7832)[;
    ]import cpw.mods.fml.relauncher.Side%(#cc7832)[;
    ]import cpw.mods.fml.relauncher.SideOnly%(#cc7832)[;
    ]import java.util.Iterator%(#cc7832)[;
    ]import java.util.Map%(#cc7832)[;
    ]import net.minecraft.block.material.MapColor%(#cc7832)[;
    ]import net.minecraft.client.renderer.OpenGlHelper%(#cc7832)[;
    ]import net.minecraft.client.renderer.Tessellator%(#cc7832)[;
    ]import net.minecraft.client.renderer.texture.DynamicTexture%(#cc7832)[;
    ]import net.minecraft.client.renderer.texture.TextureManager%(#cc7832)[;
    ]import net.minecraft.util.ResourceLocation%(#cc7832)[;
    ]import net.minecraft.world.storage.MapData%(#cc7832)[;
    ]import org.lwjgl.opengl.GL11%(#cc7832)[;
    ]
    @SideOnly(Side.*CLIENT*)
    public class MapItemRenderer
    {
       private static final ResourceLocation *field_148253_a *= new ResourceLocation("textures/map/map_icons.png")%(#cc7832)[;
    ]    private final TextureManager field_148251_b%(#cc7832)[;
    ]    private final Map field_148252_c = Maps.*newHashMap*()%(#cc7832)[;
    ]    private static final String *__OBFID *= "CL_00000663"%(#cc7832)[;
    ]
        public MapItemRenderer(TextureManager p_i45009_1_)
       {
           this.field_148251_b = p_i45009_1_%(#cc7832)[;
    ]    }
    
       public void func_148246_a(MapData p_148246_1_)
       {
           this.func_148248_b(p_148246_1_).func_148236_a()%(#cc7832)[;
    ]    }
    
       public void func_148250_a(MapData p_148250_1_, boolean p_148250_2_)
       {
           this.func_148248_b(p_148250_1_).func_148237_a(p_148250_2_)%(#cc7832)[;
    ]    }
    
       private MapItemRenderer.Instance func_148248_b(MapData p_148248_1_)
       {
           MapItemRenderer.Instance instance = (MapItemRenderer.Instance)this.field_148252_c.get(p_148248_1_.mapName)%(#cc7832)[;
    ]
            if (instance == null)
           {
               instance = new MapItemRenderer.Instance(p_148248_1_, null)%(#cc7832)[;
    ]            this.field_148252_c.put(p_148248_1_.mapName, instance)%(#cc7832)[;
    ]        }
    
           return instance%(#cc7832)[;
    ]    }
    
       public void func_148249_a()
       {
           Iterator iterator = this.field_148252_c.values().iterator()%(#cc7832)[;
    ]
            while (iterator.hasNext())
           {
               MapItemRenderer.Instance instance = (MapItemRenderer.Instance)iterator.next()%(#cc7832)[;
    ]            this.field_148251_b.deleteTexture(instance.field_148240_d)%(#cc7832)[;
    ]        }
    
           this.field_148252_c.clear()%(#cc7832)[;
    ]    }
    
       @SideOnly(Side.*CLIENT*)
       class Instance
       {
           private final MapData field_148242_b%(#cc7832)[;
    ]        private final DynamicTexture field_148243_c%(#cc7832)[;
    ]        private final ResourceLocation field_148240_d%(#cc7832)[;
    ]        private final int[] field_148241_e%(#cc7832)[;
    ]        private static final String *__OBFID *= "CL_00000665"%(#cc7832)[;
    ]
            private Instance(MapData p_i45007_2_)
           {
               this.field_148242_b = p_i45007_2_%(#cc7832)[;
    ]            this.field_148243_c = new DynamicTexture(128, 128)%(#cc7832)[;
    ]            this.field_148241_e = this.field_148243_c.getTextureData()%(#cc7832)[;
    ]            this.field_148240_d = MapItemRenderer.this.field_148251_b.getDynamicTextureLocation("map/" + p_i45007_2_.mapName, this.field_148243_c)%(#cc7832)[;
    ]
                for (int i = 0; i < this.field_148241_e.length; ++i)
               {
                   this.field_148241_e* = 0%(#cc7832)[;
    ]            }
           }
    
           private void func_148236_a()
           {
               for (int i = 0; i < 16384; ++i)
               {
                   int j = this.field_148242_b.colors* & 255%(#cc7832)[;
    ]
                    if (j / 4 == 0)
                   {
                       this.field_148241_e* = (i + i / 128 & 1) * 8 + 16 << 24%(#cc7832)[;
    ]                }
                   %(#cc7832)[else
    ]                {
                       this.field_148241_e* = MapColor.*mapColorArray*[j / 4].func_151643_b(j & 3)%(#cc7832)[;
    ]                }
               }
    
               this.field_148243_c.updateDynamicTexture()%(#cc7832)[;
    ]        }
    
           private void func_148237_a(boolean p_148237_1_)
           {
               byte b0 = 0%(#cc7832)[;
    ]            byte b1 = 0%(#cc7832)[;
    ]            Tessellator tessellator = Tessellator.*instance*%(#cc7832)[;
    ]            float f = 0.0F%(#cc7832)[;
    ]            MapItemRenderer.this.field_148251_b.bindTexture(this.field_148240_d)%(#cc7832)[;
    ]            GL11.*glEnable*(GL11.*GL_BLEND*)%(#cc7832)[;
    ]            OpenGlHelper.*glBlendFunc*(1, 771, 0, 1)%(#cc7832)[;
    ]            GL11.*glDisable*(GL11.*GL_ALPHA_TEST*)%(#cc7832)[;
    ]            tessellator.startDrawingQuads()%(#cc7832)[;
    ]            tessellator.addVertexWithUV((double)((float)(b0 + 0) + f), (double)((float)(b1 + 128) - f), -0.009999999776482582D, 0.0D, 1.0D)%(#cc7832)[;
    ]            tessellator.addVertexWithUV((double)((float)(b0 + 128) - f), (double)((float)(b1 + 128) - f), -0.009999999776482582D, 1.0D, 1.0D)%(#cc7832)[;
    ]            tessellator.addVertexWithUV((double)((float)(b0 + 128) - f), (double)((float)(b1 + 0) + f), -0.009999999776482582D, 1.0D, 0.0D)%(#cc7832)[;
    ]            tessellator.addVertexWithUV((double)((float)(b0 + 0) + f), (double)((float)(b1 + 0) + f), -0.009999999776482582D, 0.0D, 0.0D)%(#cc7832)[;
    ]            tessellator.draw()%(#cc7832)[;
    ]            GL11.*glEnable*(GL11.*GL_ALPHA_TEST*)%(#cc7832)[;
    ]            GL11.*glDisable*(GL11.*GL_BLEND*)%(#cc7832)[;
    ]            MapItemRenderer.this.field_148251_b.bindTexture(MapItemRenderer.*field_148253_a*)%(#cc7832)[;
    ]            int i = 0%(#cc7832)[;
    ]            Iterator iterator = this.field_148242_b.playersVisibleOnMap.values().iterator()%(#cc7832)[;
    ]
                while (iterator.hasNext())
               {
                   MapData.MapCoord mapcoord = (MapData.MapCoord)iterator.next()%(#cc7832)[;
    ]
                    if (!p_148237_1_ || mapcoord.iconSize == 1)
                   {
                       GL11.*glPushMatrix*()%(#cc7832)[;
    ]                    GL11.*glTranslatef*((float)b0 + (float)mapcoord.centerX / 2.0F + 64.0F, (float)b1 + (float)mapcoord.centerZ / 2.0F + 64.0F, -0.02F)%(#cc7832)[;
    ]                    GL11.*glRotatef*((float)(mapcoord.iconRotation * 360) / 16.0F, 0.0F, 0.0F, 1.0F)%(#cc7832)[;
    ]                    GL11.*glScalef*(4.0F, 4.0F, 3.0F)%(#cc7832)[;
    ]                    GL11.*glTranslatef*(-0.125F, 0.125F, 0.0F)%(#cc7832)[;
    ]                    float f1 = (float)(mapcoord.iconSize % 4 + 0) / 4.0F%(#cc7832)[;
    ]                    float f2 = (float)(mapcoord.iconSize / 4 + 0) / 4.0F%(#cc7832)[;
    ]                    float f3 = (float)(mapcoord.iconSize % 4 + 1) / 4.0F%(#cc7832)[;
    ]                    float f4 = (float)(mapcoord.iconSize / 4 + 1) / 4.0F%(#cc7832)[;
    ]                    tessellator.startDrawingQuads()%(#cc7832)[;
    ]                    tessellator.addVertexWithUV(-1.0D, 1.0D, (double)((float)i * 0.001F), (double)f1, (double)f2)%(#cc7832)[;
    ]                    tessellator.addVertexWithUV(1.0D, 1.0D, (double)((float)i * 0.001F), (double)f3, (double)f2)%(#cc7832)[;
    ]                    tessellator.addVertexWithUV(1.0D, -1.0D, (double)((float)i * 0.001F), (double)f3, (double)f4)%(#cc7832)[;
    ]                    tessellator.addVertexWithUV(-1.0D, -1.0D, (double)((float)i * 0.001F), (double)f1, (double)f4)%(#cc7832)[;
    ]                    tessellator.draw()%(#cc7832)[;
    ]                    GL11.*glPopMatrix*()%(#cc7832)[;
    ]                    ++i%(#cc7832)[;
    ]                }
               }
    
               GL11.*glPushMatrix*()%(#cc7832)[;
    ]            GL11.*glTranslatef*(0.0F, 0.0F, -0.04F)%(#cc7832)[;
    ]            GL11.*glScalef*(1.0F, 1.0F, 1.0F)%(#cc7832)[;
    ]            GL11.*glPopMatrix*()%(#cc7832)[;
    ]        }
    
           Instance(MapData p_i45008_2_, Object p_i45008_3_)
           {
               this(p_i45008_2_)%(#cc7832)[;
    ]        }
       }
    }****
    

    Et aussi quand je tente d'add un message au chat ca fait crash le jeux voici le code d'ajoute du message :

    [font=Courier Newpublic ]String[] messageArray = new String[] {"§4Erreur : la personne demandé n'existe pas."}%(#cc7832)[;
    ]%(#bbb529)[@Override
    ]public void initGui() {
       super.initGui()%(#cc7832)[;
    ]    Keyboard.*enableRepeatEvents*(true)%(#cc7832)[;
    ]
    %(#808080)[//   FontRenderer f = this.mc.fontRenderer;
    ]    int i = (this.width - this.xSize) / 2%(#cc7832)[;
    ]    int j = (this.height - this.ySize) / 2%(#cc7832)[;
    ]
    
     %(#808080)[//  g = new GuiTextField(f, 55,230, 100,100);
    ]    this.g = new GuiTextField(this.fontRendererObj, i + 62, j + 24, 103, 12)%(#cc7832)[;
    ]    this.g.setTextColor(-1)%(#cc7832)[;
    ]    this.g.setDisabledTextColour(-1)%(#cc7832)[;
    ]    this.g.setEnableBackgroundDrawing(true)%(#cc7832)[;
    ]    this.g.setMaxStringLength(40)%(#cc7832)[;
    ]
    
       %(#808080)[//   g.drawTextBox();
    ]%(#808080)[    // this.buttonList.add(g);
    ]    buttonList.add(new GuiButton(32, this.width / 2 - 100, i+ 24, 200, 20, "Valide") {
           %(#bbb529)[@Override
    ]        public void mouseReleased(int x, int y) {
               mc.currentScreen.confirmClicked(true, 1)%(#cc7832)[;
    ]            playerInv.closeInventory()%(#cc7832)[;
    ]            EntityPlayer p1 = playerInv.player%(#cc7832)[;
    ]            MinecraftServer mc1 = FMLServerHandler.*instance*().getServer()%(#cc7832)[;
    ]            for(GameProfile g1 : mc1.func_152357_F()) {
                   if(g.getText().equals(g1.getName())) {
                       EntityPlayer p = mc1.getEntityWorld().func_152378_a(g1.getId())%(#cc7832)[;
    ]                %(#808080)[//    GuiRepair
    ]%(#808080)[                    //p.inventory.addItemStackToInventory(new ItemStack(GloryRP.MenotesItem,1));
    ]                } else {
                       %(#808080)[//IChatComponent msg = IChatComponent.Serializer.func_150699_a();
    ]
    
                       p1.addChatMessage(new ChatComponentText(messageArray[p1.worldObj.rand.nextInt(messageArray.length)]))%(#cc7832)[;
    ]                }
               }
    
           }
       });
    ``` Merci de vos future réponse, cordialement.


  • Hey je me permet d'encore up, j'ai un problème au niveau du rendue, le minecraft crash .. voici le code :

    [font=Courier Newpackage ]fr.ph1823.MyLife.Item%(#cc7832)[;
    ]
    import net.minecraft.client.Minecraft%(#cc7832)[;
    ]import net.minecraft.client.gui.FontRenderer%(#cc7832)[;
    ]import net.minecraft.client.gui.MapItemRenderer%(#cc7832)[;
    ]import net.minecraft.client.renderer.Tessellator%(#cc7832)[;
    ]import net.minecraft.client.renderer.entity.RenderItem%(#cc7832)[;
    ]import net.minecraft.item.ItemMap%(#cc7832)[;
    ]import net.minecraft.item.ItemStack%(#cc7832)[;
    ]import net.minecraft.util.ResourceLocation%(#cc7832)[;
    ]import net.minecraftforge.client.IItemRenderer%(#cc7832)[;
    ]import org.lwjgl.opengl.GL11%(#cc7832)[;
    ]
    %(#629755)[*/**
    *]%(#629755)[* * Created by ph1823 - Minecraft on 28/03/2016.
    *]%(#629755)[* */
    *]public class IdentityTechneRender implements IItemRenderer {
       protected Identity model%(#cc7832)[;
    ]    private static RenderItem *renderItem *= new RenderItem()%(#cc7832)[;
    ]    protected static final ResourceLocation *texture *= new ResourceLocation("plants:textures/items/card.png")%(#cc7832)[;
    ]
        public IdentityTechneRender()
       {
    
           model = new Identity()%(#cc7832)[;
    ]
       }
    
       %(#bbb529)[@Override
    ]    public boolean handleRenderType(ItemStack item, ItemRenderType type) {
           %(#808080)[// Get icon index for the texture
    ]        net.minecraft.util.IIcon icon = item.getIconIndex()%(#cc7832)[;
    ]%(#808080)[// Use vanilla code to render the icon in a 16x16 square of inventory slot
    ]        *renderItem*.renderIcon(0, 0, icon, 16, 16)%(#cc7832)[;
    ]
           %(#808080)[//
    ]%(#808080)[// Set drawing mode (see first tutorial link above).
    ]        GL11.*glBegin*(GL11.*GL_QUADS*)%(#cc7832)[;
    ]%(#808080)[// Set semi-transparent black color
    ]        GL11.*glColor4f*(0F, 0F, 0F, 0.5F)%(#cc7832)[;
    ]
    %(#808080)[// Draw a 8x8 square
    ]        GL11.*glVertex3d*(0, 0, 0)%(#cc7832)[;
    ]        GL11.*glVertex3d*(0, 8, 0)%(#cc7832)[;
    ]        GL11.*glVertex3d*(8, 8, 0)%(#cc7832)[;
    ]        GL11.*glVertex3d*(8, 0, 0)%(#cc7832)[;
    ]
           GL11.*glEnd*()%(#cc7832)[;
    ]        byte b0 = 0%(#cc7832)[;
    ]        byte b1 = 0%(#cc7832)[;
    ]        Tessellator tessellator = Tessellator.*instance*%(#cc7832)[;
    ]        float f = 0.0F%(#cc7832)[;
    ]%(#808080)[// Set drawing mode. Tessellator should support most drawing modes.
    ]%(#808080)[       // tessellator.startDrawing(GL11.GL_QUADS);
    ]%(#808080)[// Set semi-transparent black color
    ]        tessellator.startDrawingQuads()%(#cc7832)[;
    ]        tessellator.addVertexWithUV((double)((float)(b0 + 0) + f), (double)((float)(b1 + 128) - f), -0.009999999776482582D, 0.0D, 1.0D)%(#cc7832)[;
    ]        tessellator.addVertexWithUV((double)((float)(b0 + 128) - f), (double)((float)(b1 + 128) - f), -0.009999999776482582D, 1.0D, 1.0D)%(#cc7832)[;
    ]        tessellator.addVertexWithUV((double)((float)(b0 + 128) - f), (double)((float)(b1 + 0) + f), -0.009999999776482582D, 1.0D, 0.0D)%(#cc7832)[;
    ]        tessellator.addVertexWithUV((double)((float)(b0 + 0) + f), (double)((float)(b1 + 0) + f), -0.009999999776482582D, 0.0D, 0.0D)%(#cc7832)[;
    ]        tessellator.draw()%(#cc7832)[;
    ]
    
           tessellator.draw()%(#cc7832)[;
    ]        FontRenderer fontRenderer = Minecraft.*getMinecraft*().fontRenderer%(#cc7832)[;
    ]        GL11.*glEnable*(GL11.*GL_ALPHA_TEST*)%(#cc7832)[;
    ]        GL11.*glDisable*(GL11.*GL_BLEND*)%(#cc7832)[;
    ]
           %(#808080)[// Enable texturing, because Minecraft text font is actually a texture
    ]%(#808080)[        //GL11.glEnable(GL11.GL_TEXTURE_2D);
    ]%(#808080)[// Get our text value
    ]        String text = Integer.*toString*(item.getItemDamage())%(#cc7832)[;
    ]%(#808080)[// Draw our text at (1, 1) with white color
    ]        fontRenderer.drawStringWithShadow(text, 1, 1, 0xFFFFFF)%(#cc7832)[;
    ]      %(#808080)[//   MapItemRenderer
    ]%(#808080)[//ItemMap
    ]        GL11.*glPushMatrix*()%(#cc7832)[;
    ]        GL11.*glTranslatef*(0.0F, 0.0F, -0.04F)%(#cc7832)[;
    ]        GL11.*glScalef*(1.0F, 1.0F, 1.0F)%(#cc7832)[;
    ]        GL11.*glPopMatrix*()%(#cc7832)[;
    ]        switch(type)
           {
               case *FIRST_PERSON_MAP*:
    
                   %(#cc7832)[return true;
    ]            default:
                  %(#cc7832)[return false;
    ]        }
    
          %(#808080)[// return false;
    ]    }
    
       %(#bbb529)[@Override
    ]    public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
           switch(type)
           {
               case *FIRST_PERSON_MAP*:
                   %(#cc7832)[return true;
    ]            default:
                   %(#cc7832)[return false;
    ]        }
       }
    
       %(#bbb529)[@Override
    ]    public void renderItem(ItemRenderType type, ItemStack item, Object… data) {
    
           switch(type)
           {
               case *FIRST_PERSON_MAP*:
               {
    
               }
               default:
                   %(#cc7832)[break;
    ]        }
       }
    
    }
    


  • Le crash report ?



  • Ha oui effectivement excusé moi le voici :

    [19:44:04] [Client thread/FATAL]: Reported exception thrown!
    net.minecraft.util.ReportedException: Rendering item
    at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1092) ~[blt.class:?]
    at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1001) ~[bao.class:?]
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898) [bao.class:?]
    at net.minecraft.client.main.Main.main(SourceFile:148) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_77]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    Caused by: java.lang.IllegalStateException: Not tesselating!
    at net.minecraft.client.renderer.Tessellator.func_78381_a(Tessellator.java:70) ~[bmh.class:?]
    at fr.ph1823.MyLife.Item.IdentityTechneRender.handleRenderType(IdentityTechneRender.java:65) ~[IdentityTechneRender.class:?]
    at net.minecraftforge.client.MinecraftForgeClient.getItemRenderer(MinecraftForgeClient.java:37) ~[MinecraftForgeClient.class:?]
    at net.minecraftforge.client.ForgeHooksClient.renderInventoryItem(ForgeHooksClient.java:155) ~[ForgeHooksClient.class:?]
    at net.minecraft.client.renderer.entity.RenderItem.func_82406_b(RenderItem.java:563) ~[bny.class:?]
    at net.minecraft.client.gui.inventory.GuiContainer.func_146977_a(GuiContainer.java:271) ~[bex.class:?]
    at net.minecraft.client.gui.inventory.GuiContainer.func_73863_a(GuiContainer.java:99) ~[bex.class:?]
    at net.minecraft.client.renderer.InventoryEffectRenderer.func_73863_a(InventoryEffectRenderer.java:38) ~[bfo.class:?]
    at net.minecraft.client.gui.inventory.GuiContainerCreative.func_73863_a(GuiContainerCreative.java:638) ~[bfl.class:?]
    at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1061) ~[blt.class:?]
    … 9 more
    


  • tessellator.startDrawingQuads();
    tessellator.addVertexWithUV((double)((float)(b0 + 0) + f), (double)((float)(b1 + 128) - f), -0.009999999776482582D, 0.0D, 1.0D);
    tessellator.addVertexWithUV((double)((float)(b0 + 128) - f), (double)((float)(b1 + 128) - f), -0.009999999776482582D, 1.0D, 1.0D);
    tessellator.addVertexWithUV((double)((float)(b0 + 128) - f), (double)((float)(b1 + 0) + f), -0.009999999776482582D, 1.0D, 0.0D);
    tessellator.addVertexWithUV((double)((float)(b0 + 0) + f), (double)((float)(b1 + 0) + f), -0.009999999776482582D, 0.0D, 0.0D);
    tessellator.draw();
    
    tessellator.draw();
    
    

    Tu dessines 2 fois sans commencer à dessiner, supprime le dernier

    PS : mets plutôt dans une balise code


  • Administrateurs

    La balise bt à la place de la balise code x)



  • Bonjours, maintenance ca me mais un crahs avec nullpointer exception alors que toutes mais variables sont définei voici l'erreur :

    22:59:38] [Client thread/INFO] [STDOUT]: [tv.twitch.StandardCoreAPI:<init>:16]: If on Windows, make sure to provide all of the necessary dll's as specified in the twitchsdk README. Also, make sure to set the PATH environment variable to point to the directory containing the dll's.
    [22:59:38] [Client thread/ERROR]: Couldn't initialize twitch stream
    [22:59:39] [Client thread/INFO] [STDOUT]: [cpw.mods.fml.client.SplashProgress:start:188]: –-- Minecraft Crash Report ----
    // Don't be sad, have a hug! <3
    
    Time: 31/03/16 22:59
    Description: Loading screen debug info
    
    This is just a prompt for computer specs to be printed. THIS IS NOT A ERROR
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- System Details --
    Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_77, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 51335160 bytes (48 MB) / 129761280 bytes (123 MB) up to 2100035584 bytes (2002 MB)
    JVM Flags: 3 total; -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy
    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
    FML:
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 364.51' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2'
    [22:59:39] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization
    [22:59:39] [Client thread/INFO] [FML]: MinecraftForge v10.13.4.1541 Initialized
    [22:59:39] [Client thread/INFO] [FML]: Replaced 183 ore recipies
    [22:59:39] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization
    [22:59:39] [Client thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer
    [22:59:39] [Client thread/INFO] [FML]: Searching C:\Users\ph1823 - Minecraft\AppData\Roaming\.MyLife\mods for mods
    [22:59:44] [Client thread/INFO] [FML]: Attempting to reparse the mod container [1.7.10]SecurityCraft v1.8.1.jar
    [22:59:45] [Client thread/INFO] [MonoblocksMultipart]: Mod MonoblocksMultipart is missing the required element 'name'. Substituting MonoblocksMultipart
    [22:59:45] [Client thread/INFO] [FML]: Forge Mod Loader has identified 17 mods to load
    [22:59:45] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, securitycraft, BiblioCraft, CarpentersBlocks, chisel, customnpcs, PTRModelLib, props, flansmod, flenixcities, gvc, Monoblocks, MonoblocksMultipart, cfm, MyLife] at CLIENT
    [22:59:45] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, securitycraft, BiblioCraft, CarpentersBlocks, chisel, customnpcs, PTRModelLib, props, flansmod, flenixcities, gvc, Monoblocks, MonoblocksMultipart, cfm, MyLife] at SERVER
    [22:59:47] [Client thread/ERROR] [FML]: An error occured trying to load a proxy into {serverSide=fr.ph1823.MyLife.Proxy.CommonProxy, clientSide=fr.ph1823.MyLife.Proxy.ClientProxy}.fr.ph1823.MyLife.GloryRP
    java.lang.NullPointerException
    at fr.ph1823.MyLife.Item.IdentityTechneRender.<init>(IdentityTechneRender.java:38) ~[IdentityTechneRender.class:?]
    at fr.ph1823.MyLife.Proxy.ClientProxy.<init>(ClientProxy.java:14) ~[ClientProxy.class:?]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_77]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_77]
    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_77]
    at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_77]
    at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:59) [ProxyInjector.class:?]
    at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:512) [FMLModContainer.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_77]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [guava-17.0.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) [guava-17.0.jar:?]
    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) [LoadController.class:?]
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) [LoadController.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_77]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) [guava-17.0.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) [guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) [guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) [guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) [guava-17.0.jar:?]
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?]
    at cpw.mods.fml.common.Loader.loadMods(Loader.java:513) [Loader.class:?]
    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:480) [bao.class:?]
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878) [bao.class:?]
    at net.minecraft.client.main.Main.main(SourceFile:148) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_77]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    [22:59:47] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from CONSTRUCTING to PREINITIALIZATION. Loading cannot continue
    [22:59:47] [Client thread/ERROR] [FML]:
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UC mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
    UC FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1541-1.7.10.jar)
    UC Forge{10.13.4.1541} [Minecraft Forge] (forge-1.7.10-10.13.4.1541-1.7.10.jar)
    UC securitycraft{v1.8.1} [SecurityCraft] ([1.7.10]SecurityCraft v1.8.1.jar)
    UC BiblioCraft{1.11.4} [BiblioCraft] (BiblioCraft[v1.11.4][MC1.7.10].jar)
    UC CarpentersBlocks{3.3.0 DEV R4} [Carpenter's Blocks] (CarpenterBlocks.jar)
    UC chisel{1.5.7} [Chisel] (Chisel[v1.5.7][1.7.10].jar)
    UC customnpcs{1.7.10d} [CustomNpcs] (CustomNPCs[vd][1.7.10].jar)
    UC PTRModelLib{1.0.0} [PTRModelLib] (Decocraft-2.1.1_1.7.10.jar)
    UC props{2.1.1} [Decocraft] (Decocraft-2.1.1_1.7.10.jar)
    UC flansmod{4.10.0} [Flan's Mod] (FlansMod-1.7.10-4.10.0.jar)
    UC flenixcities{0.16.1} [FlenixCities] (FlenixCitiesCore_[1.7.10]-0.16.1-b127.jar)
    UC gvc{0.6.1} [§aGliby's§f Voice Chat Mod] (GlibysVC-1.7.10-0.6.2a.jar)
    UC Monoblocks{1.10.23} [§1M§2o§3n§4o§5b§6l§7o§8c§9k§as] (Monoblocks-1.10.23.jar)
    UC MonoblocksMultipart{1.10.23} [MonoblocksMultipart] (Monoblocks-1.10.23.jar)
    UC cfm{3.4.7} [§9MrCrayfish's Furniture Mod] (MrCrayfishFurnitureModv3.4.7(1.7.10).jar)
    UE MyLife{1.0} [MyLife] (Mylife.jar)
    [22:59:47] [Client thread/ERROR] [FML]: The following problems were captured during this phase
    [22:59:47] [Client thread/ERROR] [FML]: Caught exception from MyLife
    cpw.mods.fml.common.LoaderException: java.lang.NullPointerException
    
    at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:76) ~[forge-1.7.10-10.13.4.1541-1.7.10.jar:?]
    at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:512) ~[forge-1.7.10-10.13.4.1541-1.7.10.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_77]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) ~[forge-1.7.10-10.13.4.1541-1.7.10.jar:?]
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) ~[forge-1.7.10-10.13.4.1541-1.7.10.jar:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_77]
    at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) ~[guava-17.0.jar:?]
    at com.google.common.eventbus.EventBus.post(EventBus.java:275) ~[guava-17.0.jar:?]
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?]
    at cpw.mods.fml.common.Loader.loadMods(Loader.java:513) [Loader.class:?]
    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208) [FMLClientHandler.class:?]
    at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:480) [bao.class:?]
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878) [bao.class:?]
    at net.minecraft.client.main.Main.main(SourceFile:148) [Main.class:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_77]
    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
    Caused by: java.lang.NullPointerException
    at fr.ph1823.MyLife.Item.IdentityTechneRender.<init>(IdentityTechneRender.java:38) ~[IdentityTechneRender.class:?]
    at fr.ph1823.MyLife.Proxy.ClientProxy.<init>(ClientProxy.java:14) ~[ClientProxy.class:?]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_77]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_77]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_77]
    at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_77]
    at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_77]
    at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:59) ~[forge-1.7.10-10.13.4.1541-1.7.10.jar:?]
    … 33 more
    [22:59:47] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:func_71377_b:349]: –-- Minecraft Crash Report ----
    // Quite honestly, I wouldn't worry myself about that.
    
    Time: 31/03/16 22:59
    Description: There was a severe problem during mod loading that has caused the game to fail
    
    cpw.mods.fml.common.LoaderException: java.lang.NullPointerException
    at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:76)
    at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:512)
    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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
    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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
    at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
    at com.google.common.eventbus.EventBus.post(EventBus.java:275)
    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
    at cpw.mods.fml.common.Loader.loadMods(Loader.java:513)
    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:208)
    at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:480)
    at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878)
    at net.minecraft.client.main.Main.main(SourceFile:148)
    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)
    Caused by: java.lang.NullPointerException
    at fr.ph1823.MyLife.Item.IdentityTechneRender.<init>(IdentityTechneRender.java:38)
    at fr.ph1823.MyLife.Proxy.ClientProxy.<init>(ClientProxy.java:14)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at cpw.mods.fml.common.ProxyInjector.inject(ProxyInjector.java:59)
    ... 33 more
    
    A detailed walkthrough of the error, its code path and all known details is as follows:
    ---------------------------------------------------------------------------------------
    
    -- System Details --
    Details:
    Minecraft Version: 1.7.10
    Operating System: Windows 10 (amd64) version 10.0
    Java Version: 1.8.0_77, Oracle Corporation
    Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
    Memory: 93737928 bytes (89 MB) / 212611072 bytes (202 MB) up to 2100035584 bytes (2002 MB)
    JVM Flags: 3 total; -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy
    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.1541 17 mods loaded, 17 mods active
    States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
    UC mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
    UC FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1541-1.7.10.jar)
    UC Forge{10.13.4.1541} [Minecraft Forge] (forge-1.7.10-10.13.4.1541-1.7.10.jar)
    UC securitycraft{v1.8.1} [SecurityCraft] ([1.7.10]SecurityCraft v1.8.1.jar)
    UC BiblioCraft{1.11.4} [BiblioCraft] (BiblioCraft[v1.11.4][MC1.7.10].jar)
    UC CarpentersBlocks{3.3.0 DEV R4} [Carpenter's Blocks] (CarpenterBlocks.jar)
    UC chisel{1.5.7} [Chisel] (Chisel[v1.5.7][1.7.10].jar)
    UC customnpcs{1.7.10d} [CustomNpcs] (CustomNPCs[vd][1.7.10].jar)
    UC PTRModelLib{1.0.0} [PTRModelLib] (Decocraft-2.1.1_1.7.10.jar)
    UC props{2.1.1} [Decocraft] (Decocraft-2.1.1_1.7.10.jar)
    UC flansmod{4.10.0} [Flan's Mod] (FlansMod-1.7.10-4.10.0.jar)
    UC flenixcities{0.16.1} [FlenixCities] (FlenixCitiesCore_[1.7.10]-0.16.1-b127.jar)
    UC gvc{0.6.1} [§aGliby's§f Voice Chat Mod] (GlibysVC-1.7.10-0.6.2a.jar)
    UC Monoblocks{1.10.23} [§1M§2o§3n§4o§5b§6l§7o§8c§9k§as] (Monoblocks-1.10.23.jar)
    UC MonoblocksMultipart{1.10.23} [MonoblocksMultipart] (Monoblocks-1.10.23.jar)
    UC cfm{3.4.7} [§9MrCrayfish's Furniture Mod] (MrCrayfishFurnitureModv3.4.7(1.7.10).jar)
    UE MyLife{1.0} [MyLife] (Mylife.jar)
    GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 364.51' Renderer: 'GeForce GTX 750 Ti/PCIe/SSE2'
    [22:59:47] [Client thread/INFO] [STDOUT]: [net.minecraft.client.Minecraft:func_71377_b:359]: #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\ph1823 - Minecraft\AppData\Roaming\.MyLife\crash-reports\crash-2016-03-31_22.59.47-client.txt
    
    

    et voici le code :

    [font=Courier Newpackage ]fr.ph1823.MyLife.Item%(#cc7832)[;
    ]
    import net.minecraft.client.Minecraft%(#cc7832)[;
    ]import net.minecraft.client.gui.FontRenderer%(#cc7832)[;
    ]import net.minecraft.client.gui.MapItemRenderer%(#cc7832)[;
    ]import net.minecraft.client.renderer.Tessellator%(#cc7832)[;
    ]import net.minecraft.client.renderer.entity.RenderItem%(#cc7832)[;
    ]import net.minecraft.client.renderer.texture.DynamicTexture%(#cc7832)[;
    ]import net.minecraft.client.renderer.texture.TextureManager%(#cc7832)[;
    ]import net.minecraft.item.ItemMap%(#cc7832)[;
    ]import net.minecraft.item.ItemStack%(#cc7832)[;
    ]import net.minecraft.nbt.NBTTagCompound%(#cc7832)[;
    ]import net.minecraft.nbt.NBTTagList%(#cc7832)[;
    ]import net.minecraft.nbt.NBTTagString%(#cc7832)[;
    ]import net.minecraft.util.ResourceLocation%(#cc7832)[;
    ]import net.minecraft.world.storage.MapData%(#cc7832)[;
    ]import net.minecraftforge.client.IItemRenderer%(#cc7832)[;
    ]import org.lwjgl.opengl.GL11%(#cc7832)[;
    ]
    %(#629755)[*/**
    *]%(#629755)[* * Created by ph1823 - Minecraft on 28/03/2016.
    *]%(#629755)[* */
    *]public class IdentityTechneRender implements IItemRenderer {
       protected Identity model%(#cc7832)[;
    ]    private static RenderItem *renderItem *= new RenderItem()%(#cc7832)[;
    ]    private static DynamicTexture *dyn*%(#cc7832)[;
    ]
        private static TextureManager *manager *= Minecraft.*getMinecraft*().getTextureManager()%(#cc7832)[;
    ]
        protected static ResourceLocation texture = new ResourceLocation("plants:textures/items/card.png")%(#cc7832)[;
    ]
        public IdentityTechneRender()
       {
          %(#808080)[// this.getDynamicTextureLocation()
    ]        model = new Identity()%(#cc7832)[;
    ]        *dyn *= new DynamicTexture(128, 128)%(#cc7832)[;
    ]    %(#808080)[//    this.field_148241_e = this.field_148243_c.getTextureData();
    ]        texture = *manager*.getDynamicTextureLocation("plants:textures/items/card.png", *dyn*)%(#cc7832)[;
    ]
    
       }
    
       %(#bbb529)[@Override
    ]    public boolean handleRenderType(ItemStack item, ItemRenderType type) {
           %(#808080)[// Get icon index for the texture
    ]        String text= "texte par default"%(#cc7832)[;
    ]        NBTTagCompound nbt = item.getTagCompound()%(#cc7832)[;
    ]        if (nbt != null) {
               NBTTagCompound disp = nbt.getCompoundTag("display")%(#cc7832)[;
    ]            if (disp != null) {
                   NBTTagList lore = disp.getTagList("Lore", 8)%(#cc7832)[;
    ]                if (lore != null) {
                      %(#808080)[// text = lore.getStringTagAt(0);
    ]
                   }
               }
           }
    
           *manager*.bindTexture(texture)%(#cc7832)[;
    ]        %(#808080)[//net.minecraft.util.IIcon icon = item.getIconIndex();
    ]%(#808080)[// Use vanilla code to render the icon in a 16x16 square of inventory slot
    ]%(#808080)[     //   renderItem.renderIcon(0, 0, icon, 16, 16);
    ]
    %(#808080)[        //
    ]%(#808080)[// Set drawing mode (see first tutorial link above).
    ]%(#808080)[       /* GL11.glBegin(GL11.GL_QUADS);
    ]%(#808080)[// Set semi-transparent black color
    ]%(#808080)[        GL11.glColor4f(0F, 0F, 0F, 0.5F);
    ]
    %(#808080)[// Draw a 8x8 square
    ]%(#808080)[        GL11.glVertex3d(0, 0, 0);
    ]%(#808080)[        GL11.glVertex3d(0, 8, 0);
    ]%(#808080)[        GL11.glVertex3d(8, 8, 0);
    ]%(#808080)[        GL11.glVertex3d(8, 0, 0);*/
    ]
    %(#808080)[//        GL11.glEnd();
    ]        byte b0 = 0%(#cc7832)[;
    ]        byte b1 = 0%(#cc7832)[;
    ]        Tessellator tessellator = Tessellator.*instance*%(#cc7832)[;
    ]        float f = 0.0F%(#cc7832)[;
    ]%(#808080)[// Set drawing mode. Tessellator should support most drawing modes.
    ]%(#808080)[       // tessellator.startDrawing(GL11.GL_QUADS);
    ]%(#808080)[// Set semi-transparent black color
    ]        tessellator.startDrawingQuads()%(#cc7832)[;
    ]        tessellator.addVertexWithUV((double)((float)(b0 + 0) + f), (double)((float)(b1 + 128) - f), -0.009999999776482582D, 0.0D, 1.0D)%(#cc7832)[;
    ]        tessellator.addVertexWithUV((double)((float)(b0 + 128) - f), (double)((float)(b1 + 128) - f), -0.009999999776482582D, 1.0D, 1.0D)%(#cc7832)[;
    ]        tessellator.addVertexWithUV((double)((float)(b0 + 128) - f), (double)((float)(b1 + 0) + f), -0.009999999776482582D, 1.0D, 0.0D)%(#cc7832)[;
    ]        tessellator.addVertexWithUV((double)((float)(b0 + 0) + f), (double)((float)(b1 + 0) + f), -0.009999999776482582D, 0.0D, 0.0D)%(#cc7832)[;
    ]        tessellator.draw()%(#cc7832)[;
    ]
           FontRenderer fontRenderer = Minecraft.*getMinecraft*().fontRenderer%(#cc7832)[;
    ]        GL11.*glEnable*(GL11.*GL_ALPHA_TEST*)%(#cc7832)[;
    ]        GL11.*glDisable*(GL11.*GL_BLEND*)%(#cc7832)[;
    ]
           %(#808080)[// Enable texturing, because Minecraft text font is actually a texture
    ]%(#808080)[        //GL11.glEnable(GL11.GL_TEXTURE_2D);
    ]%(#808080)[// Get our text value
    ]
    %(#808080)[// Draw our text at (1, 1) with white color
    ]        fontRenderer.drawStringWithShadow(text, 1, 1, 0xFFFFFF)%(#cc7832)[;
    ]      %(#808080)[//  MapItemRenderer
    ]%(#808080)[//ItemMap
    ]        GL11.*glPushMatrix*()%(#cc7832)[;
    ]        GL11.*glTranslatef*(0.0F, 0.0F, -0.04F)%(#cc7832)[;
    ]        GL11.*glScalef*(1.0F, 1.0F, 1.0F)%(#cc7832)[;
    ]        GL11.*glPopMatrix*()%(#cc7832)[;
    ]        switch(type)
           {
               case *FIRST_PERSON_MAP*:
    
                   %(#cc7832)[return true;
    ]            default:
                  %(#cc7832)[return false;
    ]        }
    
          %(#808080)[// return false;
    ]    }
    
       %(#bbb529)[@Override
    ]    public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
           switch(type)
           {
               case *FIRST_PERSON_MAP*:
                   %(#cc7832)[return true;
    ]            default:
                   %(#cc7832)[return false;
    ]        }
       }
    
       %(#bbb529)[@Override
    ]    public void renderItem(ItemRenderType type, ItemStack item, Object… data) {
    
           switch(type)
           {
               case *FIRST_PERSON_MAP*:
               {
    
               }
               default:
                   %(#cc7832)[break;
    ]        }
       }
    
    }
    

    La ligne de l'erreur :

    %(#a9b7c6)[[font=Courier New]*texture *]= %(#9876aa)[*manager*].getDynamicTextureLocation(%(#6a8759)["plants:textures/items/card.png"]%(#cc7832)[, ]%(#9876aa)[*dyn*])%(#cc7832)[;]
    

    La variable manager :

    %(#a9b7c6)[[font=Courier New]private static ]TextureManager %(#9876aa)[*manager *]= Minecraft.*getMinecraft*().getTextureManager()%(#cc7832)[;]
    

    La variable dyn :

    %(#a9b7c6)[[font=Courier New]dyn = new ]DynamicTexture(%(#6897bb)[128]%(#cc7832)[, ]%(#6897bb)[128])%(#cc7832)[;]
    

    Je crois que c'est car j'ai mis 128128 alors que l'image c'est du 6464 non?
    P.S Ca fait le render alors que l'ont a pas l'item en main, ca ne fait pas comme un map en plus ca le mais en haut :/</init></init></init></init></init></init></init>


  • Administrateurs

    Minecraft.getMinecraft().getTextureManager(); est surement null au moment ou tu enregistres ton rendu.
    Essaies de l'enregistrer dans init au lieu de preinit.



  • Bonjours, ceci me met toujours une erreur même dans poste event par contre, quand je désactive cette ligne :

    %(#a9b7c6)[[font=Courier New]MinecraftForgeClient.registerItemRenderer(GloryRP.Identity, new IdentityTechneRender());]
    

    dans ClientProxy ( ici :

    [font=Courier Newpackage ]fr.ph1823.MyLife.Proxy%(#cc7832)[;
    ]
    
    import fr.ph1823.MyLife.GloryRP%(#cc7832)[;
    ]import fr.ph1823.MyLife.Item.IdentityTechneRender%(#cc7832)[;
    ]import net.minecraftforge.client.IItemRenderer%(#cc7832)[;
    ]import net.minecraftforge.client.MinecraftForgeClient%(#cc7832)[;
    ]import net.minecraftforge.common.MinecraftForge%(#cc7832)[;
    ]
    public class ClientProxy extends CommonProxy {
      public ClientProxy() {
         %(#808080)[//MinecraftForgeClient.registerItemRenderer(GloryRP1.t.itemID, (IItemRenderer)new IdentityTechneRender());
    ]      MinecraftForge.*EVENT_BUS*.register(this)%(#cc7832)[;
    ]      %(#808080)[//MinecraftForgeClient.registerItemRenderer(GloryRP.Identity, new IdentityTechneRender());
    ]   }
    }
    ``` )
    Ceci ne produit plus l'erreur.


  • Euh pourquoi cette ligne au juste ?
    MinecraftForge.EVENT_BUS.register(this);

    Et après le code pour enregistrer les IITemRenderer devrait être à placer dans une méthode crée exprès pour ça, dans ton client proxy. De plus elle devrait (la méthode) être aussi présente dans ton common proxy, mais vide. Et c'est la méthode du common proxy que tu appelleras dans init.


  • Administrateurs

    Tu l'as mit dans le constructeur du client proxy, donc pas étonnant que Minecraft.getMinecraft().getTextureManager() est null à ce moment.
    Il faut mettre MinecraftForgeClient.registerItemRenderer(GloryRP.Identity, new IdentityTechneRender() à l'intérieur d'une fonction du client proxy (à toi de choisir un nom) que tu vas ensuite appelé depuis la classe principale.