Problème Invetory + Item comme une map
-
Hello, je reivent sur mon problème d’avis de recherche, voici ma classe:
%(#a9b7c6)[[font=Courier New]package ]fr.ph1823.MyLife.Item%(#cc7832)[; ] %(#cc7832)[import ]fr.ph1823.MyLife.GloryRP%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.entity.player.EntityPlayer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.Item%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.ItemStack%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.world.World%(#cc7832)[; ] %(#cc7832)[public class ]Search %(#cc7832)[extends ]Item{ %(#cc7832)[public ]Search() { setUnlocalizedName(%(#6a8759)["Search"])%(#cc7832)[; ] setTextureName(%(#6a8759)["plants:a"])%(#cc7832)[; ] setCreativeTab(GloryRP.%(#9876aa)[*plantTab*])%(#cc7832)[; ] setMaxStackSize(%(#6897bb)[1])%(#cc7832)[; ] } %(#629755)[*/** *]%(#629755)[* * Used to open the gui *]%(#629755)[* */ *] %(#bbb529)[@Override ] %(#cc7832)[public ]ItemStack %(#ffc66d)[onItemRightClick](ItemStack stack%(#cc7832)[, ]World world%(#cc7832)[, ]EntityPlayer player) { player.openGui(GloryRP.%(#9876aa)[*instance*]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]world%(#cc7832)[, ](%(#cc7832)[int]) player.%(#9876aa)[posX]%(#cc7832)[, ](%(#cc7832)[int]) player.%(#9876aa)[posY]%(#cc7832)[, ](%(#cc7832)[int]) player.%(#9876aa)[posZ])%(#cc7832)[; ]%(#cc7832)[ return ]stack%(#cc7832)[; ] } }
La classe de l’inventaire :
%(#a9b7c6)[[font=Courier New]package ]fr.ph1823.MyLife.Gui.Amandes%(#cc7832)[; ] %(#629755)[*/** *]%(#629755)[* * Created by ph1823 - Minecraft on 29/02/2016. *]%(#629755)[* */ *] %(#cc7832)[import ]com.mojang.authlib.GameProfile%(#cc7832)[; ]%(#cc7832)[import ]cpw.mods.fml.client.FMLClientHandler%(#cc7832)[; ]%(#cc7832)[import ]cpw.mods.fml.server.FMLServerHandler%(#cc7832)[; ]%(#cc7832)[import ]fr.ph1823.MyLife.GloryRP%(#cc7832)[; ]%(#cc7832)[import ]fr.ph1823.MyLife.Gui.Amandes.inv.InventoryBackPack%(#cc7832)[; ]%(#cc7832)[import ]fr.ph1823.MyLife.Item.Search%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.gui.*%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.gui.inventory.GuiContainer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.resources.I18n%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.entity.player.EntityPlayer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.entity.player.InventoryPlayer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.ItemStack%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.nbt.NBTBase%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.server.MinecraftServer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.util.IChatComponent%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.util.ResourceLocation%(#cc7832)[; ] %(#cc7832)[import ]org.lwjgl.Sys%(#cc7832)[; ]%(#cc7832)[import ]org.lwjgl.input.Keyboard%(#cc7832)[; ]%(#cc7832)[import ]org.lwjgl.opengl.GL11%(#cc7832)[; ]%(#cc7832)[import ]fr.ph1823.MyLife.Gui.Amandes.inv.container.*%(#cc7832)[; ] %(#cc7832)[import ]java.awt.*%(#cc7832)[; ]%(#cc7832)[import ]java.io.IOException%(#cc7832)[; ]%(#cc7832)[import ]java.net.URI%(#cc7832)[; ]%(#cc7832)[import ]java.util.ArrayList%(#cc7832)[; ]%(#cc7832)[import ]java.util.List%(#cc7832)[; ] %(#cc7832)[public class ]Amendes %(#cc7832)[extends ]GuiContainer { %(#cc7832)[private ]GuiTextField %(#9876aa)[g]%(#cc7832)[; ] %(#cc7832)[ public static final ]ResourceLocation %(#9876aa)[*texture *]= %(#cc7832)[new ]ResourceLocation(%(#6a8759)["guicustom"]%(#cc7832)[,]%(#6a8759)["textures/a.png"])%(#cc7832)[; ]%(#cc7832)[ protected ]InventoryBackPack %(#9876aa)[inv]%(#cc7832)[; ]%(#cc7832)[ protected ]InventoryPlayer %(#9876aa)[playerInv]%(#cc7832)[; ]%(#cc7832)[ public int ]%(#9876aa)[rows]%(#cc7832)[; ] %(#cc7832)[ public ]Amendes(InventoryPlayer playerInv%(#cc7832)[, ]InventoryBackPack inv) { %(#cc7832)[super](%(#cc7832)[new ]ContainerBackPack(playerInv%(#cc7832)[, ]inv))%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[playerInv ]= playerInv%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[inv ]= inv%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[allowUserInput ]= %(#cc7832)[false; ] %(#808080)[// Calculate the number of rows ] %(#cc7832)[this].%(#9876aa)[rows ]= inv.getSizeInventory() / %(#6897bb)[9]%(#cc7832)[; ] %(#808080)[// Height of the GUI using the number of rows ] %(#cc7832)[this].%(#9876aa)[ySize ]= %(#6897bb)[114 ]+ %(#cc7832)[this].%(#9876aa)[rows ]* %(#6897bb)[18]%(#cc7832)[; ] } %(#cc7832)[protected ]List %(#9876aa)[buttonList ]= %(#cc7832)[new ]ArrayList()%(#cc7832)[; ] %(#bbb529)[@Override ] %(#cc7832)[public void ]%(#ffc66d)[initGui]() { %(#cc7832)[super].initGui()%(#cc7832)[; ] Keyboard.*enableRepeatEvents*(%(#cc7832)[true])%(#cc7832)[; ] %(#808080)[// FontRenderer f = this.mc.fontRenderer; ] %(#cc7832)[int ]i = (%(#cc7832)[this].%(#9876aa)[width ]- %(#cc7832)[this].%(#9876aa)[xSize]) / %(#6897bb)[2]%(#cc7832)[; ]%(#cc7832)[ int ]j = (%(#cc7832)[this].%(#9876aa)[height ]- %(#cc7832)[this].%(#9876aa)[ySize]) / %(#6897bb)[2]%(#cc7832)[; ] %(#808080)[// g = new GuiTextField(f, 55,230, 100,100); ] %(#cc7832)[this].%(#9876aa)[g ]= %(#cc7832)[new ]GuiTextField(%(#cc7832)[this].%(#9876aa)[fontRendererObj]%(#cc7832)[, ]i + %(#6897bb)[62]%(#cc7832)[, ]j + %(#6897bb)[24]%(#cc7832)[, ]%(#6897bb)[103]%(#cc7832)[, ]%(#6897bb)[12])%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[g].setTextColor(-%(#6897bb)[1])%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[g].setDisabledTextColour(-%(#6897bb)[1])%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[g].setEnableBackgroundDrawing(%(#cc7832)[false])%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[g].setMaxStringLength(%(#6897bb)[40])%(#cc7832)[; ] %(#808080)[// g.drawTextBox(); ]%(#808080)[ // this.buttonList.add(g); ] %(#cc7832)[this].%(#9876aa)[buttonList].add(%(#cc7832)[new ]GuiButton(%(#6897bb)[32]%(#cc7832)[, this].%(#9876aa)[width ]/ %(#6897bb)[2 ]- %(#6897bb)[100]%(#cc7832)[, ]i+ %(#6897bb)[24]%(#cc7832)[, ]%(#6897bb)[200]%(#cc7832)[, ]%(#6897bb)[20]%(#cc7832)[, ]%(#6a8759)["Valide"]) { %(#bbb529)[@Override ] %(#cc7832)[public void ]%(#ffc66d)[mouseReleased](%(#cc7832)[int ]x%(#cc7832)[, int ]y) { %(#9876aa)[mc].%(#9876aa)[currentScreen].confirmClicked(%(#cc7832)[true, ]%(#6897bb)[1])%(#cc7832)[; ] %(#9876aa)[playerInv].closeInventory()%(#cc7832)[; ] EntityPlayer p1 = %(#9876aa)[playerInv].%(#9876aa)[player]%(#cc7832)[; ] MinecraftServer mc1 = FMLServerHandler.*instance*().getServer()%(#cc7832)[; ]%(#cc7832)[ for](GameProfile g1 : mc1.func_152357_F()) { %(#cc7832)[if](%(#9876aa)[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)); ] } %(#cc7832)[else ]{ IChatComponent msg = IChatComponent.Serializer.*func_150699_a*(%(#6a8759)["§4Erreur : la personne demandé n'existe pas."])%(#cc7832)[; ] p1.addChatMessage(msg)%(#cc7832)[; ] } } } })%(#cc7832)[; ] } %(#bbb529)[@Override ] %(#cc7832)[public void ]%(#ffc66d)[onGuiClosed]() { %(#cc7832)[super].onGuiClosed()%(#cc7832)[; ] Keyboard.*enableRepeatEvents*(%(#cc7832)[false])%(#cc7832)[; ] } %(#bbb529)[@Override ] %(#cc7832)[protected void ]%(#ffc66d)[drawGuiContainerForegroundLayer](%(#cc7832)[int ]x%(#cc7832)[, int ]y) { %(#808080)[//super.drawGuiContainerForegroundLayer(x, y); ] GL11.*glDisable*(GL11.%(#9876aa)[*GL_LIGHTING*])%(#cc7832)[; ] GL11.*glDisable*(GL11.%(#9876aa)[*GL_BLEND*])%(#cc7832)[; ] %(#cc7832)[ int ]k%(#cc7832)[; ]%(#cc7832)[ for ](k = %(#6897bb)[0]%(#cc7832)[; ]k < %(#cc7832)[this].%(#9876aa)[buttonList].size()%(#cc7832)[; ]++k) { ((GuiButton) %(#cc7832)[this].%(#9876aa)[buttonList].get(k)).drawButton(%(#cc7832)[this].%(#9876aa)[mc]%(#cc7832)[, ]x%(#cc7832)[, ]y)%(#cc7832)[; ] } GL11.*glEnable*(GL11.%(#9876aa)[*GL_LIGHTING*])%(#cc7832)[; ] } %(#808080)[/* @Override ]%(#808080)[ protected void drawGuiContainerForegroundLayer(int x, int y) { ]%(#808080)[ Keyboard.enableRepeatEvents(true); ]%(#808080)[ // 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)[ } ] %(#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 ] %(#cc7832)[protected void ]%(#ffc66d)[actionPerformed](GuiButton button) { %(#9876aa)[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)[ }*/ ] } %(#cc7832)[protected void ]%(#ffc66d)[g1]() { String s = %(#cc7832)[this].%(#9876aa)[g].getText()%(#cc7832)[; ] System.%(#9876aa)[*out*].print(s)%(#cc7832)[; ] } %(#629755)[*/** *]%(#629755)[* * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). *]%(#629755)[* */ *] %(#bbb529)[@Override ] %(#cc7832)[protected void ]%(#ffc66d)[keyTyped](%(#cc7832)[char ]p_73869_1_%(#cc7832)[, int ]p_73869_2_) { %(#cc7832)[if ](%(#cc7832)[this].%(#9876aa)[g].textboxKeyTyped(p_73869_1_%(#cc7832)[, ]p_73869_2_)) { %(#cc7832)[this].g1()%(#cc7832)[; ] } %(#cc7832)[else ] { %(#cc7832)[super].keyTyped(p_73869_1_%(#cc7832)[, ]p_73869_2_)%(#cc7832)[; ] } %(#808080)[// this.field_146308_f.setFocused(!this.field_146308_f.isFocused()); ] } %(#bbb529)[@Override ] %(#cc7832)[protected void ]%(#ffc66d)[drawGuiContainerBackgroundLayer](%(#cc7832)[float ]prt%(#cc7832)[, int ]x%(#cc7832)[, int ]y) { %(#808080)[// super.drawGuiContainerBackgroundLayer(); ] GL11.*glColor4f*(%(#6897bb)[1.0F]%(#cc7832)[, ]%(#6897bb)[1.0F]%(#cc7832)[, ]%(#6897bb)[1.0F]%(#cc7832)[, ]%(#6897bb)[1.0F])%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[mc].getTextureManager().bindTexture(%(#9876aa)[*texture*])%(#cc7832)[; ] %(#808080)[// Centering GUI ] %(#cc7832)[int ]k = (%(#cc7832)[this].%(#9876aa)[width ]- %(#cc7832)[this].%(#9876aa)[xSize]) / %(#6897bb)[2]%(#cc7832)[; ]%(#cc7832)[ int ]l = (%(#cc7832)[this].%(#9876aa)[height ]- %(#cc7832)[this].%(#9876aa)[ySize]) / %(#6897bb)[2]%(#cc7832)[; ] %(#808080)[// Drawing the first part of the GUI (slots of the backpack) ] %(#cc7832)[this].drawTexturedModalRect(k%(#cc7832)[, ]l%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, this].%(#9876aa)[xSize]%(#cc7832)[, this].%(#9876aa)[rows ]* %(#6897bb)[18 ]+ %(#6897bb)[17])%(#cc7832)[; ] %(#808080)[// And after the slots from the player's inventory ] %(#cc7832)[this].drawTexturedModalRect(k%(#cc7832)[, ]l + %(#cc7832)[this].%(#9876aa)[rows ]* %(#6897bb)[18 ]+ %(#6897bb)[17]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[126]%(#cc7832)[, this].%(#9876aa)[xSize]%(#cc7832)[, ]%(#6897bb)[96])%(#cc7832)[; ] } %(#808080)[/* @Override ]%(#808080)[ public void updateScreen() ]%(#808080)[ { ]%(#808080)[ super.updateScreen(); ]%(#808080)[ g.updateCursorCounter(); ]%(#808080)[ }*/ ] %(#bbb529)[@Override ] %(#cc7832)[protected void ]%(#ffc66d)[mouseClicked](%(#cc7832)[int ]mouseX%(#cc7832)[, int ]mouseY%(#cc7832)[, int ]mouseButton) { %(#cc7832)[super].mouseClicked(mouseX%(#cc7832)[, ]mouseY%(#cc7832)[, ]mouseButton)%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[g].mouseClicked(mouseX%(#cc7832)[, ]mouseY%(#cc7832)[, ]mouseButton)%(#cc7832)[; ] } %(#bbb529)[@Override ] %(#cc7832)[public void ]%(#ffc66d)[drawScreen](%(#cc7832)[int ]i%(#cc7832)[, int ]j%(#cc7832)[, float ]f) { %(#cc7832)[super].drawScreen(i%(#cc7832)[, ]j%(#cc7832)[, ]f)%(#cc7832)[; ] GL11.*glDisable*(GL11.%(#9876aa)[*GL_LIGHTING*])%(#cc7832)[; ] GL11.*glDisable*(GL11.%(#9876aa)[*GL_BLEND*])%(#cc7832)[; ] %(#9876aa)[g].drawTextBox()%(#cc7832)[; ] } }
Le common PROXY :
%(#a9b7c6)[[font=Courier New]package ]fr.ph1823.MyLife.Proxy%(#cc7832)[; ] %(#cc7832)[import ]fr.ph1823.MyLife.Gui.Amandes.inv.*%(#cc7832)[; ]%(#cc7832)[import ]fr.ph1823.MyLife.Gui.Amandes.inv.container.*%(#cc7832)[; ]%(#cc7832)[import ]fr.ph1823.MyLife.Gui.Amandes.*%(#cc7832)[; ]%(#cc7832)[import ]fr.ph1823.MyLife.Item.Menotes%(#cc7832)[; ]%(#cc7832)[import ]fr.ph1823.MyLife.Item.Search%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.entity.player.EntityPlayer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.world.World%(#cc7832)[; ]%(#cc7832)[import ]cpw.mods.fml.common.network.IGuiHandler%(#cc7832)[; ] %(#629755)[*/** *]%(#629755)* %(#629755)[***@author ***]%(#629755)[*SCAREX *]%(#629755)[* * *]%(#629755)[* */ *]%(#cc7832)[public class ]CommonProxy %(#cc7832)[implements ]IGuiHandler { %(#bbb529)[@Override ] %(#cc7832)[public ]Object %(#ffc66d)[getServerGuiElement](%(#cc7832)[int ]ID%(#cc7832)[, ]EntityPlayer player%(#cc7832)[, ]World world%(#cc7832)[, int ]x%(#cc7832)[, int ]y%(#cc7832)[, int ]z) { %(#cc7832)[switch ](ID) { %(#cc7832)[case ]%(#6897bb)[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 ] %(#cc7832)[if ](player.getHeldItem() == %(#cc7832)[null ]|| !(player.getHeldItem().getItem() %(#cc7832)[instanceof ]Search)) %(#cc7832)[return null; ]%(#cc7832)[ return new ]ContainerBackPack(player.%(#9876aa)[inventory]%(#cc7832)[, new ]InventoryBackPack(player.getHeldItem()%(#cc7832)[, ]%(#6897bb)[54]))%(#cc7832)[; ] } %(#cc7832)[return null; ] } %(#bbb529)[@Override ] %(#cc7832)[public ]Object %(#ffc66d)[getClientGuiElement](%(#cc7832)[int ]ID%(#cc7832)[, ]EntityPlayer player%(#cc7832)[, ]World world%(#cc7832)[, int ]x%(#cc7832)[, int ]y%(#cc7832)[, int ]z) { %(#cc7832)[switch ](ID) { %(#cc7832)[case ]%(#6897bb)[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 ] %(#cc7832)[if ](player.getHeldItem() == %(#cc7832)[null ]|| !(player.getHeldItem().getItem() %(#cc7832)[instanceof ]Search)) %(#cc7832)[return null; ]%(#cc7832)[ return new ]Amendes(player.%(#9876aa)[inventory]%(#cc7832)[, new ]InventoryBackPack(player.getHeldItem()%(#cc7832)[, ]%(#6897bb)[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 %(#a9b7c6)[[font=Courier New]package ]fr.ph1823.MyLife.Item%(#cc7832)[; ] %(#cc7832)[import ]fr.ph1823.MyLife.GloryRP%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.Item%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.ItemMap%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.ItemMapBase%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.server.v1_7_R4.ItemWorldMap%(#cc7832)[; ] %(#cc7832)[import ]java.util.Random%(#cc7832)[; ] %(#cc7832)[public class ]Identity %(#cc7832)[extends ]Item{ %(#cc7832)[public ]Identity() { Random r = %(#cc7832)[new ]Random()%(#cc7832)[; ] String name = %(#6a8759)["UnNomAléa"]%(#cc7832)[; ] String surname = %(#6a8759)["UnPrénomAléa"]%(#cc7832)[; ] %(#808080)[// int age = r.ints(10, 50).sum(); ] %(#cc7832)[int ]age = r.nextInt(%(#6897bb)[50])%(#cc7832)[; ] setUnlocalizedName(%(#6a8759)["Card"])%(#cc7832)[; ] setTextureName(%(#6a8759)["plants:card"])%(#cc7832)[;] %(#a9b7c6)[[font=Courier New]//Je bloque ici je ne sais pas comment mettre les info :/ ] %(#808080)[//getIconIndex(this). ]%(#808080)[ //this.setTextureName("").addInformation(); ] setCreativeTab(GloryRP.%(#9876aa)[*plantTab*])%(#cc7832)[; ] %(#808080)[//ItemWorldMap ]%(#808080)[ //ItemMap ]%(#808080)[ //ItemMapBase ] setMaxStackSize(%(#6897bb)[1])%(#cc7832)[; ] } } ``` Merci de votre aide, cordialement ph1823.
-
Et pour ton item carte, je n’ai pas trop compris
-
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
-
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
:%(#a9b7c6)[[font=Courier New]package ]fr.ph1823.MyLife.Item%(#cc7832)[; ] %(#cc7832)[import ]fr.ph1823.MyLife.GloryRP%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.Minecraft%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.gui.FontRenderer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.Tessellator%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.entity.RenderItem%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.Item%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.ItemStack%(#cc7832)[; ]%(#cc7832)[import ]net.minecraftforge.client.IItemRenderer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.util.IIcon%(#cc7832)[; ]%(#cc7832)[import ]org.lwjgl.opengl.GL11%(#cc7832)[; ] %(#cc7832)[import ]java.util.Random%(#cc7832)[; ] %(#cc7832)[public class ]Identity %(#cc7832)[extends ]Item %(#cc7832)[implements ]IItemRenderer { %(#cc7832)[private static ]RenderItem %(#9876aa)[*renderItem *]= %(#cc7832)[new ]RenderItem()%(#cc7832)[; ]%(#cc7832)[ public ]Identity() { Random r = %(#cc7832)[new ]Random()%(#cc7832)[; ] String name = %(#6a8759)["UnNomAléa"]%(#cc7832)[; ] String surname = %(#6a8759)["UnPrénomAléa"]%(#cc7832)[; ] %(#808080)[// int age = r.ints(10, 50).sum(); ] %(#cc7832)[int ]age = r.nextInt(%(#6897bb)[50])%(#cc7832)[; ] setUnlocalizedName(%(#6a8759)["Card"])%(#cc7832)[; ] setTextureName(%(#6a8759)["plants:card"])%(#cc7832)[; ] %(#808080)[//getIconIndex(this). ]%(#808080)[ //this.setTextureName("").addInformation(); ] setCreativeTab(GloryRP.%(#9876aa)[*plantTab*])%(#cc7832)[; ] %(#808080)[//ItemWorldMap ]%(#808080)[ //ItemMap ]%(#808080)[ //ItemMapBase ] setMaxStackSize(%(#6897bb)[1])%(#cc7832)[; ] } %(#bbb529)[@Override ] %(#cc7832)[public boolean ]%(#ffc66d)[handleRenderType](ItemStack item%(#cc7832)[, ]ItemRenderType type) { type = ItemRenderType.%(#9876aa)[*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 ] %(#9876aa)[*renderItem*].renderIcon(%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]icon%(#cc7832)[, ]%(#6897bb)[16]%(#cc7832)[, ]%(#6897bb)[16])%(#cc7832)[; ] %(#808080)[// ]%(#808080)[// Set drawing mode (see first tutorial link above). ] GL11.*glBegin*(GL11.%(#9876aa)[*GL_QUADS*])%(#cc7832)[; ]%(#808080)[// Set semi-transparent black color ] GL11.*glColor4f*(%(#6897bb)[0F]%(#cc7832)[, ]%(#6897bb)[0F]%(#cc7832)[, ]%(#6897bb)[0F]%(#cc7832)[, ]%(#6897bb)[0.5F])%(#cc7832)[; ] %(#808080)[// Draw a 8x8 square ] GL11.*glVertex3d*(%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] GL11.*glVertex3d*(%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] GL11.*glVertex3d*(%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] GL11.*glVertex3d*(%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] GL11.*glEnd*()%(#cc7832)[; ] Tessellator tessellator = Tessellator.%(#9876aa)[*instance*]%(#cc7832)[; ]%(#808080)[// Set drawing mode. Tessellator should support most drawing modes. ] tessellator.startDrawing(GL11.%(#9876aa)[*GL_QUADS*])%(#cc7832)[; ]%(#808080)[// Set semi-transparent black color ] tessellator.setColorRGBA(%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[128])%(#cc7832)[; ] %(#808080)[// Draw a 8x8 square ] tessellator.addVertex(%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] tessellator.addVertex(%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] tessellator.addVertex(%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] tessellator.addVertex(%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] tessellator.draw()%(#cc7832)[; ] FontRenderer fontRenderer = Minecraft.*getMinecraft*().%(#9876aa)[fontRenderer]%(#cc7832)[; ] %(#808080)[// Enable texturing, because Minecraft text font is actually a texture ] GL11.*glEnable*(GL11.%(#9876aa)[*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%(#cc7832)[, ]%(#6897bb)[1]%(#cc7832)[, ]%(#6897bb)[1]%(#cc7832)[, ]%(#6897bb)[0xFFFFFF])%(#cc7832)[; ] %(#cc7832)[ return ]type == ItemRenderType.%(#9876aa)[*INVENTORY*]%(#cc7832)[; ] } %(#bbb529)[@Override ] %(#cc7832)[public boolean ]%(#ffc66d)[shouldUseRenderHelper](ItemRenderType type%(#cc7832)[, ]ItemStack item%(#cc7832)[, ]ItemRendererHelper helper) { %(#cc7832)[return false; ] } %(#bbb529)[@Override ] %(#cc7832)[public void ]%(#ffc66d)[renderItem](ItemRenderType type%(#cc7832)[, ]ItemStack item%(#cc7832)[, ]Object… data) { } }
[/java]
est telle bonne ? -
ç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 :
%(#a9b7c6)[[font=Courier New]package ]net.minecraft.client.gui%(#cc7832)[; ] %(#cc7832)[import ]com.google.common.collect.Maps%(#cc7832)[; ]%(#cc7832)[import ]cpw.mods.fml.relauncher.Side%(#cc7832)[; ]%(#cc7832)[import ]%(#bbb529)[cpw.mods.fml.relauncher.SideOnly]%(#cc7832)[; ]%(#cc7832)[import ]java.util.Iterator%(#cc7832)[; ]%(#cc7832)[import ]java.util.Map%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.block.material.MapColor%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.OpenGlHelper%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.Tessellator%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.texture.DynamicTexture%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.texture.TextureManager%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.util.ResourceLocation%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.world.storage.MapData%(#cc7832)[; ]%(#cc7832)[import ]org.lwjgl.opengl.GL11%(#cc7832)[; ] %(#bbb529)[@SideOnly](Side.%(#9876aa)[*CLIENT*]) %(#cc7832)[public class ]MapItemRenderer { %(#cc7832)[private static final ]ResourceLocation %(#9876aa)[*field_148253_a *]= %(#cc7832)[new ]ResourceLocation(%(#6a8759)["textures/map/map_icons.png"])%(#cc7832)[; ]%(#cc7832)[ private final ]TextureManager %(#9876aa)[field_148251_b]%(#cc7832)[; ]%(#cc7832)[ private final ]Map %(#9876aa)[field_148252_c ]= Maps.*newHashMap*()%(#cc7832)[; ]%(#cc7832)[ private static final ]String %(#9876aa)[*__OBFID *]= %(#6a8759)["CL_00000663"]%(#cc7832)[; ] %(#cc7832)[ public ]MapItemRenderer(TextureManager p_i45009_1_) { %(#cc7832)[this].%(#9876aa)[field_148251_b ]= p_i45009_1_%(#cc7832)[; ] } %(#cc7832)[public void ]%(#ffc66d)[func_148246_a](MapData p_148246_1_) { %(#cc7832)[this].func_148248_b(p_148246_1_).func_148236_a()%(#cc7832)[; ] } %(#cc7832)[public void ]%(#ffc66d)[func_148250_a](MapData p_148250_1_%(#cc7832)[, boolean ]p_148250_2_) { %(#cc7832)[this].func_148248_b(p_148250_1_).func_148237_a(p_148250_2_)%(#cc7832)[; ] } %(#cc7832)[private ]MapItemRenderer.Instance %(#ffc66d)[func_148248_b](MapData p_148248_1_) { MapItemRenderer.Instance instance = (MapItemRenderer.Instance)%(#cc7832)[this].%(#9876aa)[field_148252_c].get(p_148248_1_.%(#9876aa)[mapName])%(#cc7832)[; ] %(#cc7832)[ if ](instance == %(#cc7832)[null]) { instance = %(#cc7832)[new ]MapItemRenderer.Instance(p_148248_1_%(#cc7832)[, null])%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[field_148252_c].put(p_148248_1_.%(#9876aa)[mapName]%(#cc7832)[, ]instance)%(#cc7832)[; ] } %(#cc7832)[return ]instance%(#cc7832)[; ] } %(#cc7832)[public void ]%(#ffc66d)[func_148249_a]() { Iterator iterator = %(#cc7832)[this].%(#9876aa)[field_148252_c].values().iterator()%(#cc7832)[; ] %(#cc7832)[ while ](iterator.hasNext()) { MapItemRenderer.Instance instance = (MapItemRenderer.Instance)iterator.next()%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[field_148251_b].deleteTexture(instance.%(#9876aa)[field_148240_d])%(#cc7832)[; ] } %(#cc7832)[this].%(#9876aa)[field_148252_c].clear()%(#cc7832)[; ] } %(#bbb529)[@SideOnly](Side.%(#9876aa)[*CLIENT*]) %(#cc7832)[class ]Instance { %(#cc7832)[private final ]MapData %(#9876aa)[field_148242_b]%(#cc7832)[; ]%(#cc7832)[ private final ]DynamicTexture %(#9876aa)[field_148243_c]%(#cc7832)[; ]%(#cc7832)[ private final ]ResourceLocation %(#9876aa)[field_148240_d]%(#cc7832)[; ]%(#cc7832)[ private final int][] %(#9876aa)[field_148241_e]%(#cc7832)[; ]%(#cc7832)[ private static final ]String %(#9876aa)[*__OBFID *]= %(#6a8759)["CL_00000665"]%(#cc7832)[; ] %(#cc7832)[ private ]Instance(MapData p_i45007_2_) { %(#cc7832)[this].%(#9876aa)[field_148242_b ]= p_i45007_2_%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[field_148243_c ]= %(#cc7832)[new ]DynamicTexture(%(#6897bb)[128]%(#cc7832)[, ]%(#6897bb)[128])%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[field_148241_e ]= %(#cc7832)[this].%(#9876aa)[field_148243_c].getTextureData()%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[field_148240_d ]= MapItemRenderer.%(#cc7832)[this].%(#9876aa)[field_148251_b].getDynamicTextureLocation(%(#6a8759)["map/" ]+ p_i45007_2_.%(#9876aa)[mapName]%(#cc7832)[, this].%(#9876aa)[field_148243_c])%(#cc7832)[; ] %(#cc7832)[ for ](%(#cc7832)[int ]i = %(#6897bb)[0]%(#cc7832)[; ]i < %(#cc7832)[this].%(#9876aa)[field_148241_e].%(#9876aa)[length]%(#cc7832)[; ]++i) { %(#cc7832)[this].%(#9876aa)[field_148241_e]* = %(#6897bb)[0]%(#cc7832)[; ] } } %(#cc7832)[private void ]%(#ffc66d)[func_148236_a]() { %(#cc7832)[for ](%(#cc7832)[int ]i = %(#6897bb)[0]%(#cc7832)[; ]i < %(#6897bb)[16384]%(#cc7832)[; ]++i) { %(#cc7832)[int ]j = %(#cc7832)[this].%(#9876aa)[field_148242_b].%(#9876aa)[colors]* & %(#6897bb)[255]%(#cc7832)[; ] %(#cc7832)[ if ](j / %(#6897bb)[4 ]== %(#6897bb)[0]) { %(#cc7832)[this].%(#9876aa)[field_148241_e]* = (i + i / %(#6897bb)[128 ]& %(#6897bb)[1]) * %(#6897bb)[8 ]+ %(#6897bb)[16 ]<< %(#6897bb)[24]%(#cc7832)[; ] } %(#cc7832)[else ] { %(#cc7832)[this].%(#9876aa)[field_148241_e]* = MapColor.%(#9876aa)[*mapColorArray*][j / %(#6897bb)[4]].func_151643_b(j & %(#6897bb)[3])%(#cc7832)[; ] } } %(#cc7832)[this].%(#9876aa)[field_148243_c].updateDynamicTexture()%(#cc7832)[; ] } %(#cc7832)[private void ]%(#ffc66d)[func_148237_a](%(#cc7832)[boolean ]p_148237_1_) { %(#cc7832)[byte ]b0 = %(#6897bb)[0]%(#cc7832)[; ]%(#cc7832)[ byte ]b1 = %(#6897bb)[0]%(#cc7832)[; ] Tessellator tessellator = Tessellator.%(#9876aa)[*instance*]%(#cc7832)[; ]%(#cc7832)[ float ]f = %(#6897bb)[0.0F]%(#cc7832)[; ] MapItemRenderer.%(#cc7832)[this].%(#9876aa)[field_148251_b].bindTexture(%(#cc7832)[this].%(#9876aa)[field_148240_d])%(#cc7832)[; ] GL11.*glEnable*(GL11.%(#9876aa)[*GL_BLEND*])%(#cc7832)[; ] OpenGlHelper.*glBlendFunc*(%(#6897bb)[1]%(#cc7832)[, ]%(#6897bb)[771]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[1])%(#cc7832)[; ] GL11.*glDisable*(GL11.%(#9876aa)[*GL_ALPHA_TEST*])%(#cc7832)[; ] tessellator.startDrawingQuads()%(#cc7832)[; ] tessellator.addVertexWithUV((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[0]) + f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[128]) - f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[0.0D]%(#cc7832)[, ]%(#6897bb)[1.0D])%(#cc7832)[; ] tessellator.addVertexWithUV((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[128]) - f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[128]) - f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[1.0D]%(#cc7832)[, ]%(#6897bb)[1.0D])%(#cc7832)[; ] tessellator.addVertexWithUV((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[128]) - f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[0]) + f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[1.0D]%(#cc7832)[, ]%(#6897bb)[0.0D])%(#cc7832)[; ] tessellator.addVertexWithUV((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[0]) + f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[0]) + f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[0.0D]%(#cc7832)[, ]%(#6897bb)[0.0D])%(#cc7832)[; ] tessellator.draw()%(#cc7832)[; ] GL11.*glEnable*(GL11.%(#9876aa)[*GL_ALPHA_TEST*])%(#cc7832)[; ] GL11.*glDisable*(GL11.%(#9876aa)[*GL_BLEND*])%(#cc7832)[; ] MapItemRenderer.%(#cc7832)[this].%(#9876aa)[field_148251_b].bindTexture(MapItemRenderer.%(#9876aa)[*field_148253_a*])%(#cc7832)[; ]%(#cc7832)[ int ]i = %(#6897bb)[0]%(#cc7832)[; ] Iterator iterator = %(#cc7832)[this].%(#9876aa)[field_148242_b].%(#9876aa)[playersVisibleOnMap].values().iterator()%(#cc7832)[; ] %(#cc7832)[ while ](iterator.hasNext()) { MapData.MapCoord mapcoord = (MapData.MapCoord)iterator.next()%(#cc7832)[; ] %(#cc7832)[ if ](!p_148237_1_ || mapcoord.%(#9876aa)[iconSize ]== %(#6897bb)[1]) { GL11.*glPushMatrix*()%(#cc7832)[; ] GL11.*glTranslatef*((%(#cc7832)[float])b0 + (%(#cc7832)[float])mapcoord.%(#9876aa)[centerX ]/ %(#6897bb)[2.0F ]+ %(#6897bb)[64.0F]%(#cc7832)[, ](%(#cc7832)[float])b1 + (%(#cc7832)[float])mapcoord.%(#9876aa)[centerZ ]/ %(#6897bb)[2.0F ]+ %(#6897bb)[64.0F]%(#cc7832)[, ]-%(#6897bb)[0.02F])%(#cc7832)[; ] GL11.*glRotatef*((%(#cc7832)[float])(mapcoord.%(#9876aa)[iconRotation ]* %(#6897bb)[360]) / %(#6897bb)[16.0F]%(#cc7832)[, ]%(#6897bb)[0.0F]%(#cc7832)[, ]%(#6897bb)[0.0F]%(#cc7832)[, ]%(#6897bb)[1.0F])%(#cc7832)[; ] GL11.*glScalef*(%(#6897bb)[4.0F]%(#cc7832)[, ]%(#6897bb)[4.0F]%(#cc7832)[, ]%(#6897bb)[3.0F])%(#cc7832)[; ] GL11.*glTranslatef*(-%(#6897bb)[0.125F]%(#cc7832)[, ]%(#6897bb)[0.125F]%(#cc7832)[, ]%(#6897bb)[0.0F])%(#cc7832)[; ]%(#cc7832)[ float ]f1 = (%(#cc7832)[float])(mapcoord.%(#9876aa)[iconSize ]% %(#6897bb)[4 ]+ %(#6897bb)[0]) / %(#6897bb)[4.0F]%(#cc7832)[; ]%(#cc7832)[ float ]f2 = (%(#cc7832)[float])(mapcoord.%(#9876aa)[iconSize ]/ %(#6897bb)[4 ]+ %(#6897bb)[0]) / %(#6897bb)[4.0F]%(#cc7832)[; ]%(#cc7832)[ float ]f3 = (%(#cc7832)[float])(mapcoord.%(#9876aa)[iconSize ]% %(#6897bb)[4 ]+ %(#6897bb)[1]) / %(#6897bb)[4.0F]%(#cc7832)[; ]%(#cc7832)[ float ]f4 = (%(#cc7832)[float])(mapcoord.%(#9876aa)[iconSize ]/ %(#6897bb)[4 ]+ %(#6897bb)[1]) / %(#6897bb)[4.0F]%(#cc7832)[; ] tessellator.startDrawingQuads()%(#cc7832)[; ] tessellator.addVertexWithUV(-%(#6897bb)[1.0D]%(#cc7832)[, ]%(#6897bb)[1.0D]%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])i * %(#6897bb)[0.001F])%(#cc7832)[, ](%(#cc7832)[double])f1%(#cc7832)[, ](%(#cc7832)[double])f2)%(#cc7832)[; ] tessellator.addVertexWithUV(%(#6897bb)[1.0D]%(#cc7832)[, ]%(#6897bb)[1.0D]%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])i * %(#6897bb)[0.001F])%(#cc7832)[, ](%(#cc7832)[double])f3%(#cc7832)[, ](%(#cc7832)[double])f2)%(#cc7832)[; ] tessellator.addVertexWithUV(%(#6897bb)[1.0D]%(#cc7832)[, ]-%(#6897bb)[1.0D]%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])i * %(#6897bb)[0.001F])%(#cc7832)[, ](%(#cc7832)[double])f3%(#cc7832)[, ](%(#cc7832)[double])f4)%(#cc7832)[; ] tessellator.addVertexWithUV(-%(#6897bb)[1.0D]%(#cc7832)[, ]-%(#6897bb)[1.0D]%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])i * %(#6897bb)[0.001F])%(#cc7832)[, ](%(#cc7832)[double])f1%(#cc7832)[, ](%(#cc7832)[double])f4)%(#cc7832)[; ] tessellator.draw()%(#cc7832)[; ] GL11.*glPopMatrix*()%(#cc7832)[; ] ++i%(#cc7832)[; ] } } GL11.*glPushMatrix*()%(#cc7832)[; ] GL11.*glTranslatef*(%(#6897bb)[0.0F]%(#cc7832)[, ]%(#6897bb)[0.0F]%(#cc7832)[, ]-%(#6897bb)[0.04F])%(#cc7832)[; ] GL11.*glScalef*(%(#6897bb)[1.0F]%(#cc7832)[, ]%(#6897bb)[1.0F]%(#cc7832)[, ]%(#6897bb)[1.0F])%(#cc7832)[; ] GL11.*glPopMatrix*()%(#cc7832)[; ] } Instance(MapData p_i45008_2_%(#cc7832)[, ]Object p_i45008_3_) { %(#cc7832)[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 :
%(#a9b7c6)[[font=Courier New]public ]String[] %(#9876aa)[messageArray ]= %(#cc7832)[new ]String[] {%(#6a8759)["§4Erreur : la personne demandé n'existe pas."]}%(#cc7832)[; ]%(#bbb529)[@Override ]%(#cc7832)[public void ]%(#ffc66d)[initGui]() { %(#cc7832)[super].initGui()%(#cc7832)[; ] Keyboard.*enableRepeatEvents*(%(#cc7832)[true])%(#cc7832)[; ] %(#808080)[// FontRenderer f = this.mc.fontRenderer; ] %(#cc7832)[int ]i = (%(#cc7832)[this].%(#9876aa)[width ]- %(#cc7832)[this].%(#9876aa)[xSize]) / %(#6897bb)[2]%(#cc7832)[; ]%(#cc7832)[ int ]j = (%(#cc7832)[this].%(#9876aa)[height ]- %(#cc7832)[this].%(#9876aa)[ySize]) / %(#6897bb)[2]%(#cc7832)[; ] %(#808080)[// g = new GuiTextField(f, 55,230, 100,100); ] %(#cc7832)[this].%(#9876aa)[g ]= %(#cc7832)[new ]GuiTextField(%(#cc7832)[this].%(#9876aa)[fontRendererObj]%(#cc7832)[, ]i + %(#6897bb)[62]%(#cc7832)[, ]j + %(#6897bb)[24]%(#cc7832)[, ]%(#6897bb)[103]%(#cc7832)[, ]%(#6897bb)[12])%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[g].setTextColor(-%(#6897bb)[1])%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[g].setDisabledTextColour(-%(#6897bb)[1])%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[g].setEnableBackgroundDrawing(%(#cc7832)[true])%(#cc7832)[; ]%(#cc7832)[ this].%(#9876aa)[g].setMaxStringLength(%(#6897bb)[40])%(#cc7832)[; ] %(#808080)[// g.drawTextBox(); ]%(#808080)[ // this.buttonList.add(g); ] %(#9876aa)[buttonList].add(%(#cc7832)[new ]GuiButton(%(#6897bb)[32]%(#cc7832)[, this].%(#9876aa)[width ]/ %(#6897bb)[2 ]- %(#6897bb)[100]%(#cc7832)[, ]i+ %(#6897bb)[24]%(#cc7832)[, ]%(#6897bb)[200]%(#cc7832)[, ]%(#6897bb)[20]%(#cc7832)[, ]%(#6a8759)["Valide"]) { %(#bbb529)[@Override ] %(#cc7832)[public void ]%(#ffc66d)[mouseReleased](%(#cc7832)[int ]x%(#cc7832)[, int ]y) { %(#9876aa)[mc].%(#9876aa)[currentScreen].confirmClicked(%(#cc7832)[true, ]%(#6897bb)[1])%(#cc7832)[; ] %(#9876aa)[playerInv].closeInventory()%(#cc7832)[; ] EntityPlayer p1 = %(#9876aa)[playerInv].%(#9876aa)[player]%(#cc7832)[; ] MinecraftServer mc1 = FMLServerHandler.*instance*().getServer()%(#cc7832)[; ]%(#cc7832)[ for](GameProfile g1 : mc1.func_152357_F()) { %(#cc7832)[if](%(#9876aa)[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)); ] } %(#cc7832)[else ]{ %(#808080)[//IChatComponent msg = IChatComponent.Serializer.func_150699_a(); ] p1.addChatMessage(%(#cc7832)[new ]ChatComponentText(%(#9876aa)[messageArray][p1.%(#9876aa)[worldObj].%(#9876aa)[rand].nextInt(%(#9876aa)[messageArray].%(#9876aa)[length])]))%(#cc7832)[; ] } } } })%(#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 :
%(#a9b7c6)[[font=Courier New]package ]fr.ph1823.MyLife.Item%(#cc7832)[; ] %(#cc7832)[import ]net.minecraft.client.Minecraft%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.gui.FontRenderer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.gui.MapItemRenderer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.Tessellator%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.entity.RenderItem%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.ItemMap%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.ItemStack%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.util.ResourceLocation%(#cc7832)[; ]%(#cc7832)[import ]net.minecraftforge.client.IItemRenderer%(#cc7832)[; ]%(#cc7832)[import ]org.lwjgl.opengl.GL11%(#cc7832)[; ] %(#629755)[*/** *]%(#629755)[* * Created by ph1823 - Minecraft on 28/03/2016. *]%(#629755)[* */ *]%(#cc7832)[public class ]IdentityTechneRender %(#cc7832)[implements ]IItemRenderer { %(#cc7832)[protected ]Identity %(#9876aa)[model]%(#cc7832)[; ]%(#cc7832)[ private static ]RenderItem %(#9876aa)[*renderItem *]= %(#cc7832)[new ]RenderItem()%(#cc7832)[; ]%(#cc7832)[ protected static final ]ResourceLocation %(#9876aa)[*texture *]= %(#cc7832)[new ]ResourceLocation(%(#6a8759)["plants:textures/items/card.png"])%(#cc7832)[; ] %(#cc7832)[ public ]IdentityTechneRender() { %(#9876aa)[model ]= %(#cc7832)[new ]Identity()%(#cc7832)[; ] } %(#bbb529)[@Override ] %(#cc7832)[public boolean ]%(#ffc66d)[handleRenderType](ItemStack item%(#cc7832)[, ]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 ] %(#9876aa)[*renderItem*].renderIcon(%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]icon%(#cc7832)[, ]%(#6897bb)[16]%(#cc7832)[, ]%(#6897bb)[16])%(#cc7832)[; ] %(#808080)[// ]%(#808080)[// Set drawing mode (see first tutorial link above). ] GL11.*glBegin*(GL11.%(#9876aa)[*GL_QUADS*])%(#cc7832)[; ]%(#808080)[// Set semi-transparent black color ] GL11.*glColor4f*(%(#6897bb)[0F]%(#cc7832)[, ]%(#6897bb)[0F]%(#cc7832)[, ]%(#6897bb)[0F]%(#cc7832)[, ]%(#6897bb)[0.5F])%(#cc7832)[; ] %(#808080)[// Draw a 8x8 square ] GL11.*glVertex3d*(%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] GL11.*glVertex3d*(%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] GL11.*glVertex3d*(%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] GL11.*glVertex3d*(%(#6897bb)[8]%(#cc7832)[, ]%(#6897bb)[0]%(#cc7832)[, ]%(#6897bb)[0])%(#cc7832)[; ] GL11.*glEnd*()%(#cc7832)[; ]%(#cc7832)[ byte ]b0 = %(#6897bb)[0]%(#cc7832)[; ]%(#cc7832)[ byte ]b1 = %(#6897bb)[0]%(#cc7832)[; ] Tessellator tessellator = Tessellator.%(#9876aa)[*instance*]%(#cc7832)[; ]%(#cc7832)[ float ]f = %(#6897bb)[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((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[0]) + f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[128]) - f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[0.0D]%(#cc7832)[, ]%(#6897bb)[1.0D])%(#cc7832)[; ] tessellator.addVertexWithUV((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[128]) - f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[128]) - f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[1.0D]%(#cc7832)[, ]%(#6897bb)[1.0D])%(#cc7832)[; ] tessellator.addVertexWithUV((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[128]) - f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[0]) + f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[1.0D]%(#cc7832)[, ]%(#6897bb)[0.0D])%(#cc7832)[; ] tessellator.addVertexWithUV((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[0]) + f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[0]) + f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[0.0D]%(#cc7832)[, ]%(#6897bb)[0.0D])%(#cc7832)[; ] tessellator.draw()%(#cc7832)[; ] tessellator.draw()%(#cc7832)[; ] FontRenderer fontRenderer = Minecraft.*getMinecraft*().%(#9876aa)[fontRenderer]%(#cc7832)[; ] GL11.*glEnable*(GL11.%(#9876aa)[*GL_ALPHA_TEST*])%(#cc7832)[; ] GL11.*glDisable*(GL11.%(#9876aa)[*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%(#cc7832)[, ]%(#6897bb)[1]%(#cc7832)[, ]%(#6897bb)[1]%(#cc7832)[, ]%(#6897bb)[0xFFFFFF])%(#cc7832)[; ] %(#808080)[// MapItemRenderer ]%(#808080)[//ItemMap ] GL11.*glPushMatrix*()%(#cc7832)[; ] GL11.*glTranslatef*(%(#6897bb)[0.0F]%(#cc7832)[, ]%(#6897bb)[0.0F]%(#cc7832)[, ]-%(#6897bb)[0.04F])%(#cc7832)[; ] GL11.*glScalef*(%(#6897bb)[1.0F]%(#cc7832)[, ]%(#6897bb)[1.0F]%(#cc7832)[, ]%(#6897bb)[1.0F])%(#cc7832)[; ] GL11.*glPopMatrix*()%(#cc7832)[; ]%(#cc7832)[ switch](type) { %(#cc7832)[case ]%(#9876aa)[*FIRST_PERSON_MAP*]: %(#cc7832)[return true; ]%(#cc7832)[ default]: %(#cc7832)[return false; ] } %(#808080)[// return false; ] } %(#bbb529)[@Override ] %(#cc7832)[public boolean ]%(#ffc66d)[shouldUseRenderHelper](ItemRenderType type%(#cc7832)[, ]ItemStack item%(#cc7832)[, ]ItemRendererHelper helper) { %(#cc7832)[switch](type) { %(#cc7832)[case ]%(#9876aa)[*FIRST_PERSON_MAP*]: %(#cc7832)[return true; ]%(#cc7832)[ default]: %(#cc7832)[return false; ] } } %(#bbb529)[@Override ] %(#cc7832)[public void ]%(#ffc66d)[renderItem](ItemRenderType type%(#cc7832)[, ]ItemStack item%(#cc7832)[, ]Object… data) { %(#cc7832)[switch](type) { %(#cc7832)[case ]%(#9876aa)[*FIRST_PERSON_MAP*]: { } %(#cc7832)[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
-
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 :
%(#a9b7c6)[[font=Courier New]package ]fr.ph1823.MyLife.Item%(#cc7832)[; ] %(#cc7832)[import ]net.minecraft.client.Minecraft%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.gui.FontRenderer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.gui.MapItemRenderer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.Tessellator%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.entity.RenderItem%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.texture.DynamicTexture%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.client.renderer.texture.TextureManager%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.ItemMap%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.item.ItemStack%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.nbt.NBTTagCompound%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.nbt.NBTTagList%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.nbt.NBTTagString%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.util.ResourceLocation%(#cc7832)[; ]%(#cc7832)[import ]net.minecraft.world.storage.MapData%(#cc7832)[; ]%(#cc7832)[import ]net.minecraftforge.client.IItemRenderer%(#cc7832)[; ]%(#cc7832)[import ]org.lwjgl.opengl.GL11%(#cc7832)[; ] %(#629755)[*/** *]%(#629755)[* * Created by ph1823 - Minecraft on 28/03/2016. *]%(#629755)[* */ *]%(#cc7832)[public class ]IdentityTechneRender %(#cc7832)[implements ]IItemRenderer { %(#cc7832)[protected ]Identity %(#9876aa)[model]%(#cc7832)[; ]%(#cc7832)[ private static ]RenderItem %(#9876aa)[*renderItem *]= %(#cc7832)[new ]RenderItem()%(#cc7832)[; ]%(#cc7832)[ private static ]DynamicTexture %(#9876aa)[*dyn*]%(#cc7832)[; ] %(#cc7832)[ private static ]TextureManager %(#9876aa)[*manager *]= Minecraft.*getMinecraft*().getTextureManager()%(#cc7832)[; ] %(#cc7832)[ protected static ]ResourceLocation texture = %(#cc7832)[new ]ResourceLocation(%(#6a8759)["plants:textures/items/card.png"])%(#cc7832)[; ] %(#cc7832)[ public ]IdentityTechneRender() { %(#808080)[// this.getDynamicTextureLocation() ] %(#9876aa)[model ]= %(#cc7832)[new ]Identity()%(#cc7832)[; ] %(#9876aa)[*dyn *]= %(#cc7832)[new ]DynamicTexture(%(#6897bb)[128]%(#cc7832)[, ]%(#6897bb)[128])%(#cc7832)[; ] %(#808080)[// this.field_148241_e = this.field_148243_c.getTextureData(); ] texture = %(#9876aa)[*manager*].getDynamicTextureLocation(%(#6a8759)["plants:textures/items/card.png"]%(#cc7832)[, ]%(#9876aa)[*dyn*])%(#cc7832)[; ] } %(#bbb529)[@Override ] %(#cc7832)[public boolean ]%(#ffc66d)[handleRenderType](ItemStack item%(#cc7832)[, ]ItemRenderType type) { %(#808080)[// Get icon index for the texture ] String text= %(#6a8759)["texte par default"]%(#cc7832)[; ] NBTTagCompound nbt = item.getTagCompound()%(#cc7832)[; ]%(#cc7832)[ if ](nbt != %(#cc7832)[null]) { NBTTagCompound disp = nbt.getCompoundTag(%(#6a8759)["display"])%(#cc7832)[; ]%(#cc7832)[ if ](disp != %(#cc7832)[null]) { NBTTagList lore = disp.getTagList(%(#6a8759)["Lore"]%(#cc7832)[, ]%(#6897bb)[8])%(#cc7832)[; ]%(#cc7832)[ if ](lore != %(#cc7832)[null]) { %(#808080)[// text = lore.getStringTagAt(0); ] } } } %(#9876aa)[*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(); ] %(#cc7832)[byte ]b0 = %(#6897bb)[0]%(#cc7832)[; ]%(#cc7832)[ byte ]b1 = %(#6897bb)[0]%(#cc7832)[; ] Tessellator tessellator = Tessellator.%(#9876aa)[*instance*]%(#cc7832)[; ]%(#cc7832)[ float ]f = %(#6897bb)[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((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[0]) + f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[128]) - f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[0.0D]%(#cc7832)[, ]%(#6897bb)[1.0D])%(#cc7832)[; ] tessellator.addVertexWithUV((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[128]) - f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[128]) - f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[1.0D]%(#cc7832)[, ]%(#6897bb)[1.0D])%(#cc7832)[; ] tessellator.addVertexWithUV((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[128]) - f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[0]) + f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[1.0D]%(#cc7832)[, ]%(#6897bb)[0.0D])%(#cc7832)[; ] tessellator.addVertexWithUV((%(#cc7832)[double])((%(#cc7832)[float])(b0 + %(#6897bb)[0]) + f)%(#cc7832)[, ](%(#cc7832)[double])((%(#cc7832)[float])(b1 + %(#6897bb)[0]) + f)%(#cc7832)[, ]-%(#6897bb)[0.009999999776482582D]%(#cc7832)[, ]%(#6897bb)[0.0D]%(#cc7832)[, ]%(#6897bb)[0.0D])%(#cc7832)[; ] tessellator.draw()%(#cc7832)[; ] FontRenderer fontRenderer = Minecraft.*getMinecraft*().%(#9876aa)[fontRenderer]%(#cc7832)[; ] GL11.*glEnable*(GL11.%(#9876aa)[*GL_ALPHA_TEST*])%(#cc7832)[; ] GL11.*glDisable*(GL11.%(#9876aa)[*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%(#cc7832)[, ]%(#6897bb)[1]%(#cc7832)[, ]%(#6897bb)[1]%(#cc7832)[, ]%(#6897bb)[0xFFFFFF])%(#cc7832)[; ] %(#808080)[// MapItemRenderer ]%(#808080)[//ItemMap ] GL11.*glPushMatrix*()%(#cc7832)[; ] GL11.*glTranslatef*(%(#6897bb)[0.0F]%(#cc7832)[, ]%(#6897bb)[0.0F]%(#cc7832)[, ]-%(#6897bb)[0.04F])%(#cc7832)[; ] GL11.*glScalef*(%(#6897bb)[1.0F]%(#cc7832)[, ]%(#6897bb)[1.0F]%(#cc7832)[, ]%(#6897bb)[1.0F])%(#cc7832)[; ] GL11.*glPopMatrix*()%(#cc7832)[; ]%(#cc7832)[ switch](type) { %(#cc7832)[case ]%(#9876aa)[*FIRST_PERSON_MAP*]: %(#cc7832)[return true; ]%(#cc7832)[ default]: %(#cc7832)[return false; ] } %(#808080)[// return false; ] } %(#bbb529)[@Override ] %(#cc7832)[public boolean ]%(#ffc66d)[shouldUseRenderHelper](ItemRenderType type%(#cc7832)[, ]ItemStack item%(#cc7832)[, ]ItemRendererHelper helper) { %(#cc7832)[switch](type) { %(#cc7832)[case ]%(#9876aa)[*FIRST_PERSON_MAP*]: %(#cc7832)[return true; ]%(#cc7832)[ default]: %(#cc7832)[return false; ] } } %(#bbb529)[@Override ] %(#cc7832)[public void ]%(#ffc66d)[renderItem](ItemRenderType type%(#cc7832)[, ]ItemStack item%(#cc7832)[, ]Object… data) { %(#cc7832)[switch](type) { %(#cc7832)[case ]%(#9876aa)[*FIRST_PERSON_MAP*]: { } %(#cc7832)[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> -
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 :
%(#a9b7c6)[[font=Courier New]package ]fr.ph1823.MyLife.Proxy%(#cc7832)[; ] %(#cc7832)[import ]fr.ph1823.MyLife.GloryRP%(#cc7832)[; ]%(#cc7832)[import ]fr.ph1823.MyLife.Item.IdentityTechneRender%(#cc7832)[; ]%(#cc7832)[import ]net.minecraftforge.client.IItemRenderer%(#cc7832)[; ]%(#cc7832)[import ]net.minecraftforge.client.MinecraftForgeClient%(#cc7832)[; ]%(#cc7832)[import ]net.minecraftforge.common.MinecraftForge%(#cc7832)[; ] %(#cc7832)[public class ]ClientProxy %(#cc7832)[extends ]CommonProxy { %(#cc7832)[public ]ClientProxy() { %(#808080)[//MinecraftForgeClient.registerItemRenderer(GloryRP1.t.itemID, (IItemRenderer)new IdentityTechneRender()); ] MinecraftForge.%(#9876aa)[*EVENT_BUS*].register(%(#cc7832)[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.
-
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.