Résolu [1.7.10] Problème de chargement de Texture
-
Bonsoir, j’ai crée un GUI s’affichant lorsque l’on presse la touche “R” cependant la texture ne s’affiche pas.
voici la classe du GUI :package fr.ntmod.com.jobs; import org.lwjgl.opengl.GL11; import fr.ntmod.com.common.MainClass; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.util.ResourceLocation; public class GuiJobs extends GuiScreen { int guiWidth = 296; //Largeur du GUI int guiHeight = 212; //Hauteur du GUI Minecraft mc = Minecraft.getMinecraft(); @Override public void drawScreen(int x, int y, float ticks) { int guiX = (width - guiWidth) / 2; // le gui sera au milieu de l'écran int guiY = (height - guiHeight) / 2; // pareil GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); //couleur du GUI ( rouge , bleu, vert, transparence ) drawDefaultBackground(); mc.renderEngine.bindTexture(new ResourceLocation(MainClass.MODID, "textures/gui/jobs.png")); //cherche la texture du GUI drawTexturedModalRect(guiX, guiY, 0, 0, guiWidth, guiHeight); super.drawScreen(x, y, ticks); } }
Ma classe Principaple :
package fr.ntmod.com.common; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import fr.ntmod.com.proxy.CommonProxy; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.Item.ToolMaterial; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.event.entity.player.FillBucketEvent; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; import world.WorldRegister; @Mod(modid = "novatechmod", name = "Mod NovaTech", version = "1.1") public class MainClass { @Instance("novatechmod") public static MainClass instance; public static final String MODID = "novatechmod"; @SidedProxy(clientSide = "fr.ntmod.com.proxy.ClientProxy", serverSide = "fr.ntmod.com.proxy.CommonProxy") public static CommonProxy proxy; /* * Declarations */ public static Fluid poisonFluid; public static ArmorMaterial antiGArmor = EnumHelper.addArmorMaterial("antiGArmor", 40, new int[] {8, 8, 8, 8}, 20); public static ArmorMaterial nikraniumArmor = EnumHelper.addArmorMaterial("nikraniumArmor", 40, new int[] {8, 8, 8, 8}, 20); public static ToolMaterial nikraniumTool = EnumHelper.addToolMaterial("nikraniumTool", 3, 1600, 15.0F, 5.0F, 20); public static ArmorMaterial protoniumArmor = EnumHelper.addArmorMaterial("protoniumArmor", 50, new int[] {10, 10, 10, 10}, 40); public static ToolMaterial protoniumTool = EnumHelper.addToolMaterial("protoniumTool", 3, 2000, 20.0F, 6.0F, 40); public static ToolMaterial hammerTool = EnumHelper.addToolMaterial("hammerTool", 1, 500, 1.0F, 1.0F, 0); public static Item nikraniumIngot, angelicRing, nikraniumSeeds, protoniumSeeds, protoniumIngot, ironStick, poisonBucket, protoniumShard, nikraniumShard, protoniumHammer; public static Item nikraniumHelmet, nikraniumChestplate, nikraniumLeggings, nikraniumBoots, protoniumHelmet, protoniumChestplate, protoniumLeggings, protoniumBoots, antiGravityBoots; public static Item nikraniumSword, nikraniumPickaxe, nikraniumAxe, nikraniumShovel, protoniumSword, protoniumPickaxe, protoniumAxe, protoniumShovel; public static Block nikraniumOre, nikraniumBlock, nikraniumCrop, protoniumCrop, protoniumOre, poisonBlock, chiseledRedstone, lightRed; public static Block hardenedObsidian, hardenedObsidian1, hardenedObsidian2, hardenedObsidian3, hardenedObsidian4, hardenedObsidian5; public static CreativeTabs novatechTabs = new NovatechTabs("novatechTabs") { @Override public Item getTabIconItem() { return Item.getItemFromBlock(MainClass.nikraniumBlock); } @SideOnly(Side.CLIENT) public int func_151243_f() { return 0; } }; public static CreativeTabs secondTab = new SecondTab("secondTabs") { @Override public Item getTabIconItem() { return Item.getItemFromBlock(MainClass.hardenedObsidian); } @SideOnly(Side.CLIENT) public int func_151243_f() { return 0; } }; @EventHandler public void preInit(FMLPreInitializationEvent event) { /* * Instancification ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ nikraniumOre = new NikraniumOre(Material.rock).setBlockName("nikraniumOre").setBlockTextureName(MODID + ":nikraniumOre").setCreativeTab(MainClass.novatechTabs); nikraniumBlock = new NikraniumBlock(Material.rock).setBlockName("nikraniumBlock").setBlockTextureName(MODID + ":nikraniumBlock").setCreativeTab(MainClass.novatechTabs); nikraniumCrop = new NikraniumCrop().setBlockName("nikraniumCrop").setBlockTextureName(MODID + ":nikraniumCrop"); protoniumCrop = new ProtoniumCrop().setBlockName("protoniumCrop").setBlockTextureName(MODID + ":protoniumCrop"); protoniumOre = new ProtoniumOre(Material.rock).setBlockName("protoniumOre").setBlockTextureName(MODID + ":protoniumOre").setCreativeTab(MainClass.novatechTabs); chiseledRedstone = new ChiseledRedstone(Material.rock).setCreativeTab(MainClass.novatechTabs).setBlockName("chiseledRestone").setBlockTextureName(MODID + ":chiseledRestone"); lightRed = new LightRed(Material.rock).setCreativeTab(MainClass.novatechTabs).setBlockName("lightRed").setBlockTextureName(MODID + ":lightRed"); hardenedObsidian = new HardenedObsidian(Material.rock).setCreativeTab(MainClass.secondTab).setBlockName("hardenedObsidian"); hardenedObsidian1 = new HardenedObsidian1(Material.rock).setCreativeTab(MainClass.secondTab).setBlockName("hardenedObsidian1"); hardenedObsidian2 = new HardenedObsidian2(Material.rock).setCreativeTab(MainClass.secondTab).setBlockName("hardenedObsidian2"); hardenedObsidian3 = new HardenedObsidian3(Material.rock).setCreativeTab(MainClass.secondTab).setBlockName("hardenedObsidian3"); hardenedObsidian4 = new HardenedObsidian4(Material.rock).setCreativeTab(MainClass.secondTab).setBlockName("hardenedObsidian4"); hardenedObsidian5 = new HardenedObsidian5(Material.rock).setCreativeTab(MainClass.secondTab).setBlockName("hardenedObsidian5"); poisonFluid = new Fluid("poison").setDensity(4000).setViscosity(500).setTemperature(286).setLuminosity(10).setUnlocalizedName("poison"); FluidRegistry.registerFluid(poisonFluid); poisonFluid = FluidRegistry.getFluid("poison"); poisonBlock = new BlockFluidPoison(poisonFluid, Material.water).setBlockTextureName(MainClass.MODID + ":poison_flow"); GameRegistry.registerBlock(poisonBlock, poisonBlock.getUnlocalizedName().substring(5)); poisonBucket = new ItemBucketPoison(MainClass.poisonBlock).setUnlocalizedName("poisonbucket").setCreativeTab(CreativeTabs.tabMisc).setContainerItem(Items.bucket).setTextureName(MainClass.MODID + ":poisonbucket").setCreativeTab(MainClass.novatechTabs); GameRegistry.registerItem(poisonBucket , "poisonbucket"); FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("poison", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(MainClass.poisonBucket), FluidContainerRegistry.EMPTY_BUCKET); nikraniumIngot = new NikraniumIngot().setUnlocalizedName("nikraniumIngot").setCreativeTab(MainClass.novatechTabs); angelicRing = new AngelicRing().setUnlocalizedName("angelicRing").setTextureName(MODID + ":angelicRing").setCreativeTab(MainClass.novatechTabs); nikraniumSeeds = new NikraniumSeeds(MainClass.nikraniumCrop, Blocks.farmland).setUnlocalizedName("nikraniumSeeds").setTextureName(MODID + ":nikraniumSeeds").setCreativeTab(MainClass.novatechTabs); protoniumSeeds = new ProtoniumSeeds(MainClass.protoniumCrop, Blocks.farmland).setUnlocalizedName("protoniumSeeds").setTextureName(MODID + ":protoniumSeeds").setCreativeTab(MainClass.novatechTabs); protoniumIngot = new ProtoniumIngot().setUnlocalizedName("protoniumIngot").setCreativeTab(MainClass.novatechTabs); ironStick = new IronStick().setUnlocalizedName("ironStick").setCreativeTab(MainClass.novatechTabs); protoniumShard = new ProtoniumShard().setUnlocalizedName("protoniumShard").setCreativeTab(MainClass.novatechTabs); nikraniumShard = new NikraniumShard().setUnlocalizedName("nikraniumShard").setCreativeTab(MainClass.novatechTabs); protoniumHammer = new ProtoniumHammer(MainClass.hammerTool).setUnlocalizedName("protoniumHammer").setCreativeTab(MainClass.novatechTabs).setTextureName(MODID + ":protoniumHammer"); nikraniumSword = new NikraniumSword(MainClass.nikraniumTool).setUnlocalizedName("nikraniumSword").setTextureName(MODID + ":nikraniumSword").setCreativeTab(MainClass.novatechTabs); nikraniumPickaxe = new NikraniumPickaxe(MainClass.nikraniumTool).setUnlocalizedName("nikraniumPickaxe").setTextureName(MODID + ":nikraniumPickaxe").setCreativeTab(MainClass.novatechTabs); nikraniumAxe = new NikraniumAxe(MainClass.nikraniumTool).setUnlocalizedName("nikraniumAxe").setTextureName(MODID + ":nikraniumAxe").setCreativeTab(MainClass.novatechTabs); nikraniumShovel = new NikraniumShovel(MainClass.nikraniumTool).setUnlocalizedName("nikraniumShovel").setTextureName(MODID + ":nikraniumShovel").setCreativeTab(MainClass.novatechTabs); protoniumSword = new ProtoniumSword(MainClass.protoniumTool).setUnlocalizedName("protoniumSword").setTextureName(MODID + ":protoniumSword").setCreativeTab(MainClass.novatechTabs); protoniumPickaxe = new ProtoniumPickaxe(MainClass.protoniumTool).setUnlocalizedName("protoniumPickaxe").setTextureName(MODID + ":protoniumPickaxe").setCreativeTab(MainClass.novatechTabs); protoniumAxe = new ProtoniumAxe(MainClass.protoniumTool).setUnlocalizedName("protoniumAxe").setTextureName(MODID + ":protoniumAxe").setCreativeTab(MainClass.novatechTabs); protoniumShovel = new ProtoniumShovel(MainClass.protoniumTool).setUnlocalizedName("protoniumShovel").setTextureName(MODID + ":protoniumShovel").setCreativeTab(MainClass.novatechTabs); nikraniumHelmet = new NikraniumArmor(nikraniumArmor, 0).setUnlocalizedName("nikraniumHelmet").setTextureName(MODID + ":nikraniumHelmet").setCreativeTab(MainClass.novatechTabs); nikraniumChestplate = new NikraniumArmor(nikraniumArmor, 1).setUnlocalizedName("nikraniumChestplate").setTextureName(MODID + ":nikraniumChestplate").setCreativeTab(MainClass.novatechTabs); nikraniumLeggings = new NikraniumArmor(nikraniumArmor, 2).setUnlocalizedName("nikraniumLeggings").setTextureName(MODID + ":nikraniumLeggings").setCreativeTab(MainClass.novatechTabs); nikraniumBoots = new NikraniumArmor(nikraniumArmor, 3).setUnlocalizedName("nikraniumBoots").setTextureName(MODID + ":nikraniumBoots").setCreativeTab(MainClass.novatechTabs); antiGravityBoots = new AntiGArmor(antiGArmor, 3).setUnlocalizedName("antiGravityBoots").setTextureName(MODID + ":antiGravityBoots").setCreativeTab(MainClass.novatechTabs); protoniumHelmet = new ProtoniumArmor(protoniumArmor, 0).setUnlocalizedName("protoniumHelmet").setTextureName(MODID + ":protoniumHelmet").setCreativeTab(MainClass.novatechTabs); protoniumChestplate = new ProtoniumArmor(protoniumArmor, 1).setUnlocalizedName("protoniumChestplate").setTextureName(MODID + ":protoniumChestplate").setCreativeTab(MainClass.novatechTabs); protoniumLeggings = new ProtoniumArmor(protoniumArmor, 2).setUnlocalizedName("protoniumLeggings").setTextureName(MODID + ":protoniumLeggings").setCreativeTab(MainClass.novatechTabs); protoniumBoots = new ProtoniumArmor(protoniumArmor, 3).setUnlocalizedName("protoniumBoots").setTextureName(MODID + ":protoniumBoots").setCreativeTab(MainClass.novatechTabs); /* * Enregistrements ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- */ GameRegistry.registerItem(nikraniumIngot, "nikraniumIngot"); GameRegistry.registerItem(angelicRing, "angelicRing"); GameRegistry.registerItem(nikraniumSeeds, "nikraniumSeeds"); GameRegistry.registerItem(protoniumSeeds, "protoniumSeeds"); GameRegistry.registerItem(protoniumIngot, "protoniumIngot"); GameRegistry.registerItem(ironStick, "ironStick"); GameRegistry.registerItem(protoniumShard, "protoniumShard"); GameRegistry.registerItem(nikraniumShard, "nikraniumShard"); GameRegistry.registerItem(nikraniumSword, "nikraniumSword"); GameRegistry.registerItem(nikraniumPickaxe, "nikraniumPickaxe"); GameRegistry.registerItem(nikraniumAxe, "nikraniumAxe"); GameRegistry.registerItem(nikraniumShovel, "nikraniumShovel"); GameRegistry.registerItem(protoniumSword, "protoniumSword"); GameRegistry.registerItem(protoniumPickaxe, "protoniumPickaxe"); GameRegistry.registerItem(protoniumAxe, "protoniumAxe"); GameRegistry.registerItem(protoniumShovel, "protoniumShovel"); GameRegistry.registerItem(protoniumHammer, "protoniumHammer"); GameRegistry.registerItem(nikraniumHelmet, "nikraniumHelmet"); GameRegistry.registerItem(nikraniumChestplate, "nikraniumChestplate"); GameRegistry.registerItem(nikraniumLeggings, "nikraniumLeggings"); GameRegistry.registerItem(nikraniumBoots, "nikraniumBoots"); GameRegistry.registerItem(protoniumHelmet, "protoniumHelmet"); GameRegistry.registerItem(protoniumChestplate, "protoniumChestplate"); GameRegistry.registerItem(protoniumLeggings, "protoniumLeggings"); GameRegistry.registerItem(protoniumBoots, "protoniumBoots"); GameRegistry.registerItem(antiGravityBoots, "antiGravityBoots"); GameRegistry.registerBlock(nikraniumOre, "nikraniumOre"); GameRegistry.registerBlock(nikraniumBlock, "nikraniumBlock"); GameRegistry.registerBlock(nikraniumCrop, "nikraniumCrop"); GameRegistry.registerBlock(protoniumCrop, "protoniumCrop"); GameRegistry.registerBlock(protoniumOre, "protoniumOre"); GameRegistry.registerBlock(chiseledRedstone, "chiseledRedstone"); GameRegistry.registerBlock(lightRed, "lightRed"); GameRegistry.registerBlock(hardenedObsidian, "hardenedObsidian"); GameRegistry.registerBlock(hardenedObsidian1, "hardenedObsidian1"); GameRegistry.registerBlock(hardenedObsidian2, "hardenedObsidian2"); GameRegistry.registerBlock(hardenedObsidian3, "hardenedObsidian3"); GameRegistry.registerBlock(hardenedObsidian4, "hardenedObsidian4"); GameRegistry.registerBlock(hardenedObsidian5, "hardenedObsidian5"); GameRegistry.addRecipe(new ItemStack(ironStick), new Object[] {" I ", " S ", " I ", 'S', new ItemStack(Items.stick), 'I', new ItemStack(Blocks.iron_block)}); GameRegistry.addRecipe(new ItemStack(ironStick), new Object[] {"I ", "S ", "I ", 'S', new ItemStack(Items.stick), 'I', new ItemStack(Blocks.iron_block)}); GameRegistry.addRecipe(new ItemStack(ironStick), new Object[] {" I", " S", " I", 'S', new ItemStack(Items.stick), 'I', new ItemStack(Blocks.iron_block)}); GameRegistry.addRecipe(new ItemStack(nikraniumSword), new Object[] {" #", " #", " S", '#', new ItemStack(MainClass.nikraniumIngot), 'S', new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(nikraniumSword), new Object[] {" # ", " # ", " S ", '#', new ItemStack(MainClass.nikraniumIngot), 'S', new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(nikraniumSword), new Object[] {"# ", "# ", "S ", '#', new ItemStack(MainClass.nikraniumIngot), 'S', new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(protoniumSword), new Object[] {" #", " #", " S", '#', new ItemStack(MainClass.protoniumIngot), 'S', new ItemStack(MainClass.ironStick)}); GameRegistry.addRecipe(new ItemStack(protoniumSword), new Object[] {" # ", " # ", " S ", '#', new ItemStack(MainClass.protoniumIngot), 'S', new ItemStack(MainClass.ironStick)}); GameRegistry.addRecipe(new ItemStack(protoniumSword), new Object[] {"# ", "# ", "S ", '#', new ItemStack(MainClass.protoniumIngot), 'S', new ItemStack(MainClass.ironStick)}); GameRegistry.addRecipe(new ItemStack(nikraniumPickaxe), new Object[] {"###", " S ", " S ", '#', new ItemStack(MainClass.nikraniumIngot), 'S', new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(protoniumPickaxe), new Object[] {"###", " S ", " S ", '#', new ItemStack(MainClass.protoniumIngot), 'S', new ItemStack(MainClass.ironStick)}); GameRegistry.addRecipe(new ItemStack(nikraniumAxe), new Object[] {" ##", " S#", " S ", '#', new ItemStack(MainClass.nikraniumIngot), 'S', new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(nikraniumAxe), new Object[] {"## ", "#S ", " S ", '#', new ItemStack(MainClass.nikraniumIngot), 'S', new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(protoniumAxe), new Object[] {" ##", " S#", " S ", '#', new ItemStack(MainClass.protoniumIngot), 'S', new ItemStack(MainClass.ironStick)}); GameRegistry.addRecipe(new ItemStack(protoniumAxe), new Object[] {"## ", "#S ", " S ", '#', new ItemStack(MainClass.protoniumIngot), 'S', new ItemStack(MainClass.ironStick)}); GameRegistry.addRecipe(new ItemStack(nikraniumShovel), new Object[] {" # ", " S ", " S ", '#', new ItemStack(MainClass.nikraniumIngot), 'S', new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(nikraniumShovel), new Object[] {"# ", "S ", "S ", '#', new ItemStack(MainClass.nikraniumIngot), 'S', new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(nikraniumShovel), new Object[] {" #", " S", " S", '#', new ItemStack(MainClass.nikraniumIngot), 'S', new ItemStack(Items.stick)}); GameRegistry.addRecipe(new ItemStack(protoniumShovel), new Object[] {" # ", " S ", " S ", '#', new ItemStack(MainClass.protoniumIngot), 'S', new ItemStack(MainClass.ironStick)}); GameRegistry.addRecipe(new ItemStack(protoniumShovel), new Object[] {"# ", "S ", "S ", '#', new ItemStack(MainClass.protoniumIngot), 'S', new ItemStack(MainClass.ironStick)}); GameRegistry.addRecipe(new ItemStack(protoniumShovel), new Object[] {" #", " S", " S", '#', new ItemStack(MainClass.protoniumIngot), 'S', new ItemStack(MainClass.ironStick)}); GameRegistry.addRecipe(new ItemStack(nikraniumHelmet), new Object[] {"###", "# #", " ", '#', new ItemStack(MainClass.nikraniumIngot)}); GameRegistry.addRecipe(new ItemStack(nikraniumHelmet), new Object[] {" ", "###", "# #", '#', new ItemStack(MainClass.nikraniumIngot)}); GameRegistry.addRecipe(new ItemStack(nikraniumChestplate), new Object[] {"# #", "###", "###", '#', new ItemStack(MainClass.nikraniumIngot)}); GameRegistry.addRecipe(new ItemStack(nikraniumLeggings), new Object[] {"###", "# #", "# #", '#', new ItemStack(MainClass.nikraniumIngot)}); GameRegistry.addRecipe(new ItemStack(nikraniumBoots), new Object[] {"# #", "# #", " ", '#', new ItemStack(MainClass.nikraniumIngot)}); GameRegistry.addRecipe(new ItemStack(nikraniumBoots), new Object[] {" ", "# #", "# #", '#', new ItemStack(MainClass.nikraniumIngot)}); GameRegistry.addRecipe(new ItemStack(protoniumHelmet), new Object[] {"###", "# #", " ", '#', new ItemStack(MainClass.protoniumIngot)}); GameRegistry.addRecipe(new ItemStack(protoniumHelmet), new Object[] {" ", "###", "# #", '#', new ItemStack(MainClass.protoniumIngot)}); GameRegistry.addRecipe(new ItemStack(protoniumChestplate), new Object[] {"# #", "###", "###", '#', new ItemStack(MainClass.protoniumIngot)}); GameRegistry.addRecipe(new ItemStack(protoniumLeggings), new Object[] {"###", "# #", "# #", '#', new ItemStack(MainClass.protoniumIngot)}); GameRegistry.addRecipe(new ItemStack(protoniumBoots), new Object[] {"# #", "# #", " ", '#', new ItemStack(MainClass.protoniumIngot)}); GameRegistry.addRecipe(new ItemStack(protoniumBoots), new Object[] {" ", "# #", "# #", '#', new ItemStack(MainClass.protoniumIngot)}); GameRegistry.addRecipe(new ItemStack(hardenedObsidian), new Object[] {"OOO", "O#O", "OOO", '#', new ItemStack(MainClass.protoniumIngot), 'O', new ItemStack(Blocks.obsidian)}); GameRegistry.addRecipe(new ItemStack(protoniumIngot), new Object[] {"###", "###", "###", '#', new ItemStack(MainClass.protoniumShard)}); GameRegistry.addRecipe(new ItemStack(nikraniumIngot), new Object[] {"###", "###", "###", '#', new ItemStack(MainClass.nikraniumShard)}); GameRegistry.addShapelessRecipe(new ItemStack(protoniumShard, 9), new Object[] {protoniumIngot}); GameRegistry.addSmelting(MainClass.nikraniumOre, new ItemStack(MainClass.nikraniumIngot), 10.0F); GameRegistry.addSmelting(MainClass.protoniumOre, new ItemStack(MainClass.protoniumShard), 20.0F); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); WorldRegister.MainRegistry(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void onBucketFill(FillBucketEvent event) { Block id = event.world.getBlock(event.target.blockX, event.target.blockY, event.target.blockZ); int metadata = event.world.getBlockMetadata(event.target.blockX, event.target.blockY, event.target.blockZ); if(id == this.poisonBlock && metadata == 0) { event.world.setBlockToAir(event.target.blockX, event.target.blockY, event.target.blockZ); if (!event.world.isRemote){ event.entityPlayer.inventory.consumeInventoryItem(Items.bucket); EntityItem itemsc = new EntityItem(event.world, event.entityPlayer.posX, event.entityPlayer.posY, event.entityPlayer.posZ, new ItemStack(this.poisonBucket, 1)); event.world.spawnEntityInWorld(itemsc); } } } }
Lorsque j’appuie sur “R” le gui s’ouvre mais m’affiche ceci :
(https://imgur.com/a/0c1gCSk celle avec les carreaux noirs et roses )Alors que mon image est celle juste en dessous.
Merci de votre aide ^^ -
@Aracno21 a dit dans [1.7.10] Problème de chargement de Texture :
mc.renderEngine.bindTexture(new ResourceLocation(MainClass.MODID, "textures/gui/jobs.png")); //cherche la texture du GUI
Et si tu remplace par ça, ça donne quoi ?
mc.renderEngine.bindTexture(new ResourceLocation(MainClass.MODID, ":textures/gui/jobs.png"));
-
@M4TH1EU_ a dit dans [1.7.10] Problème de chargement de Texture :
mc.renderEngine.bindTexture(new ResourceLocation(MainClass.MODID, “:textures/gui/jobs.png”));
J’ai essayer ces trois façons :
mc.renderEngine.bindTexture(new ResourceLocation(MainClass.MODID, "textures/gui/jobs.png")); mc.renderEngine.bindTexture(new ResourceLocation(MainClass.MODID, ":textures/gui/jobs.png")); et mc.renderEngine.bindTexture(new ResourceLocation("novatechmod:textures/gui/jobs.png"));
Mais ça ne change rien, ma texture reste buggée.
Cependant je ne sais pas si ça a quelque chose a voir mais j’ai mis la class du GUI dans un autre package que mes items et blocks ( je voulais utiliser un package pour les jobs car c’est quelque chose de spécial)
^^ -
Bonsoir,
Non le fait d’avoir un package difféent ne cause pas de problème.
Pour les ResourceLocation, la première et la dernière façon sont ok, pas la deuxième.Vérifies que la texture est bien présente dans ton IDE dans src/main/resources, si ce n’est pas le cas rafraichis l’espace le projet.
-
@robin4002
Bonsoir,La méthode
new ResourceLocation(Main.MODID + ":textures/gui/gui_carte_identite.png");
fonctionne parfaitement pour moi en 1.12.2. Étonnant que cela ne fonctionne pas ici…
-
Ça c’est bon oui.
Par contre
mc.renderEngine.bindTexture(new ResourceLocation(MainClass.MODID, ":textures/gui/jobs.png"));
ne l’est pas.Il faut soit mettre le
:
soit mettre la virgule mais pas les deux. -
J’ai essyer les differentes façons et je ne sais pourquoi mais le fait de changer de package avait surement quelque chose a voir. Cependant j’ai réussi a charger la texture en en changeant le nom de la texture donc voila, merci beaucoup a vous ^^