Résolu Texture qui ne se charge pas
-
Salut à toi qui lira ce message !
Voilà, pour démarrer, je code sous 1.5.2, et j’utilise les meta-datas, j’ai suivi les tutoriaux présents sur le site, j’ai créer des vitres colorés, pas de soucis, elle s’affiche bien, j’ai donc créer une classe générale qui mer servira pour tous mes blocks qui utiliserons les 16 couleurs, classe que voici :
package fr.crunch.mods; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; public class Blockcolored extends Block{ private Icon[] iconArray; public static String[] type = new String[]{"black", "blue", "brown", "cyan", "gray", "green", "lime", "light_blue","magenta", "orange", "pink", "purple", "red", "silver", "white", "yellow"}; public Blockcolored(int id, Material par2Material){ super(id, par2Material); } @SideOnly(Side.CLIENT) public Icon getIcon(int par1, int par2) { return par2 < type.length && par2 >= 0 ? iconArray[par2] : blockIcon; } public int damageDropped(int par1) { return par1; } public static int getBlockFromDye(int par0) { return ~par0 & 15; } public static int getDyeFromBlock(int par0) { return ~par0 & 15; } @SideOnly(Side.CLIENT) public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List) { for (int j = 0; j < type.length; j++) { par3List.add(new ItemStack(par1, 1, j)); } } @SideOnly(Side.CLIENT) public boolean isOpaqueCube() { return true; } public boolean renderAsNormalBlock() { return true; } @SideOnly(Side.CLIENT) @Override public void registerIcons(IconRegister par1IconRegister) { iconArray = new Icon[type.length]; for (int i = 0; i < type.length; i++) { iconArray* = par1IconRegister.registerIcon("antrax:"+this.getUnlocalizedName()+"_" + type*); } } }
j’ai également ma classe principale :
package fr.crunch.mods; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import fr.crunch.mods.ItemColored; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.*; 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.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid= "antrax", name ="antrax-block", version = "1.0") @NetworkMod(clientSideRequired = true, serverSideRequired = true) public class Blocks { public static Block hardened_clay; public static Block Glass_colored; public static Block hardened_clay_stained; public static final CreativeTabs onglet = new OngletCreatif(CreativeTabs.getNextID(), "Onglet Créatif Personnalisé"); @PreInit public void preload(FMLPreInitializationEvent ev){ //Configuration //Blocks hardened_clay = new Block(2000, Material.sand).setCreativeTab(this.onglet).setUnlocalizedName("hardened_clay").setHardness(1.0F); Glass_colored = new BlockGlass(2001).setCreativeTab(this.onglet).setUnlocalizedName("ColoredGlass"); hardened_clay_stained = new Blockcolored(2002, Material.sand).setCreativeTab(this.onglet).setUnlocalizedName("hardened_clay_stained"); //Items //Achievements } @Init public void load(FMLInitializationEvent ev){ //Registry GameRegistry.registerBlock(hardened_clay, "Argile durci"); GameRegistry.registerBlock(Glass_colored, ItemColoredGlass.class, "ColoredGlass"); GameRegistry.registerBlock(hardened_clay_stained, ItemColored.class, "Argile durci coloré"); //Mobs //Render //Network } @PostInit public void modloaded(FMLPostInitializationEvent ev){ //Language LanguageRegistry.addName(hardened_clay, "Argile durci"); LanguageRegistry.addName(Glass_colored, "Vitre Coloré"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.cyan.name", "Argile durci cyan"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.black.name", "Argile durci noire"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.blue.name", "Argile durci bleue"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.brown.name", "Argile durci marron"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.gray.name", "Argile durci grise"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.green.name", "Argile durci verte"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.lime.name", "Argile durci verte claire"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.light_blue.name", "Argile durci bleue claire"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.magenta.name", "Argile durci magenta"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.orange.name", "Argile durci orange"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.pink.name", "Argile durci rose"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.purple.name", "Argile durci violette"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.red.name", "Argile durci rouge"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.silver.name", "Argile durci argentée"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.white.name", "Argile durci blanche"); LanguageRegistry.instance().addStringLocalization("tile.hardened_clay_stained.yellow.name", "Argile durci jaune"); //Recipe GameRegistry.addRecipe(new ItemStack(hardened_clay), new Object[] { "X", Character.valueOf('X'), Item.stick}); } }
mes images sont dans le bon dossier, vu que mes vitres fonctionnent :
et voici ma console :
2014-03-09 11:40:33 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_cyan.png, but that file does not exist. Ignoring. 2014-03-09 11:40:33 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_purple.png, but that file does not exist. Ignoring. 2014-03-09 11:40:33 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_red.png, but that file does not exist. Ignoring. 2014-03-09 11:40:33 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_magenta.png, but that file does not exist. Ignoring. 2014-03-09 11:40:33 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_orange.png, but that file does not exist. Ignoring. 2014-03-09 11:40:33 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file textures/blocks/hardened_clay.png, but that file does not exist. Ignoring. 2014-03-09 11:40:34 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_green.png, but that file does not exist. Ignoring. 2014-03-09 11:40:34 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_pink.png, but that file does not exist. Ignoring. 2014-03-09 11:40:34 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_light_blue.png, but that file does not exist. Ignoring. 2014-03-09 11:40:34 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_brown.png, but that file does not exist. Ignoring. 2014-03-09 11:40:34 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_lime.png, but that file does not exist. Ignoring. 2014-03-09 11:40:34 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_black.png, but that file does not exist. Ignoring. 2014-03-09 11:40:34 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_blue.png, but that file does not exist. Ignoring. 2014-03-09 11:40:34 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_silver.png, but that file does not exist. Ignoring. 2014-03-09 11:40:34 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_white.png, but that file does not exist. Ignoring. 2014-03-09 11:40:34 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_yellow.png, but that file does not exist. Ignoring. 2014-03-09 11:40:34 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_gray.png, but that file does not exist. Ignoring. 2014-03-09 11:40:35 [Infos] [STDERR] java.lang.NoSuchFieldException: GL_ARB_copy_image 2014-03-09 11:40:35 [Infos] [STDERR] at java.lang.Class.getField(Class.java:1579) 2014-03-09 11:40:35 [Infos] [STDERR] at cpw.mods.fml.client.TextureFXManager.getHelper(TextureFXManager.java:122) 2014-03-09 11:40:35 [Infos] [STDERR] at net.minecraft.client.renderer.texture.TextureStitched.init(TextureStitched.java:74) 2014-03-09 11:40:35 [Infos] [STDERR] at net.minecraft.client.renderer.texture.TextureMap.refreshTextures(TextureMap.java:154) 2014-03-09 11:40:35 [Infos] [STDERR] at net.minecraft.client.renderer.RenderEngine.refreshTextureMaps(RenderEngine.java:520) 2014-03-09 11:40:35 [Infos] [STDERR] at net.minecraft.client.Minecraft.startGame(Minecraft.java:443) 2014-03-09 11:40:35 [Infos] [STDERR] at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44) 2014-03-09 11:40:35 [Infos] [STDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:732) 2014-03-09 11:40:35 [Infos] [STDERR] at java.lang.Thread.run(Thread.java:744) 2014-03-09 11:40:35 [Infos] [ForgeModLoader] Forge Mod Loader has detected an older LWJGL version, new advanced texture animation features are disabled 2014-03-09 11:40:35 [Infos] [ForgeModLoader] Not using advanced OpenGL 4.3 advanced capability for animations : OpenGL 4.3 is not available 2014-03-09 11:40:35 [Infos] [Minecraft-Client] Found animation info for: textures/blocks/lava_flow.txt 2014-03-09 11:40:35 [Infos] [Minecraft-Client] Found animation info for: textures/blocks/water_flow.txt 2014-03-09 11:40:35 [Infos] [Minecraft-Client] Found animation info for: textures/blocks/fire_0.txt 2014-03-09 11:40:35 [Infos] [Minecraft-Client] Found animation info for: textures/blocks/fire_1.txt 2014-03-09 11:40:35 [Infos] [Minecraft-Client] Found animation info for: textures/blocks/lava.txt 2014-03-09 11:40:35 [Infos] [Minecraft-Client] Found animation info for: textures/blocks/portal.txt 2014-03-09 11:40:35 [Infos] [Minecraft-Client] Found animation info for: textures/blocks/water.txt 2014-03-09 11:40:36 [Infos] [Minecraft-Client] Found animation info for: textures/items/clock.txt 2014-03-09 11:40:36 [Infos] [Minecraft-Client] Found animation info for: textures/items/compass.txt 2014-03-09 11:40:36 [Infos] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods 2014-03-09 11:40:38 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_cyan.png, but that file does not exist. Ignoring. 2014-03-09 11:40:39 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_purple.png, but that file does not exist. Ignoring. 2014-03-09 11:40:39 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_red.png, but that file does not exist. Ignoring. 2014-03-09 11:40:39 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_magenta.png, but that file does not exist. Ignoring. 2014-03-09 11:40:39 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_orange.png, but that file does not exist. Ignoring. 2014-03-09 11:40:39 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file textures/blocks/hardened_clay.png, but that file does not exist. Ignoring. 2014-03-09 11:40:39 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_green.png, but that file does not exist. Ignoring. 2014-03-09 11:40:39 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_pink.png, but that file does not exist. Ignoring. 2014-03-09 11:40:39 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_light_blue.png, but that file does not exist. Ignoring. 2014-03-09 11:40:39 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_brown.png, but that file does not exist. Ignoring. 2014-03-09 11:40:39 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_lime.png, but that file does not exist. Ignoring. 2014-03-09 11:40:39 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_black.png, but that file does not exist. Ignoring. 2014-03-09 11:40:40 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_blue.png, but that file does not exist. Ignoring. 2014-03-09 11:40:40 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_silver.png, but that file does not exist. Ignoring. 2014-03-09 11:40:40 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_white.png, but that file does not exist. Ignoring. 2014-03-09 11:40:40 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_yellow.png, but that file does not exist. Ignoring. 2014-03-09 11:40:40 [Avertissement] [Minecraft-Client] TextureManager.createTexture called for file mods/antrax/textures/blocks/tile.hardened_clay_stained_gray.png, but that file does not exist. Ignoring.
Je suis vraiment perdu, je ne comprend pas pourquoi cela ne fonctionne pas, les vitres fonctionnent elles mais la clay non, je tient à signaler que je suis au courant que ces blocs existent dans les versions plus récentes du jeux mais que je veux tout de même coder en 1.5.2 ( oui je suis têtu )
Merci à ceux qui prendront la peine et auront le courage de se pencher avec moi sur ce problème.
-
iconArray* = par1IconRegister.registerIcon("antrax:"+this.getUnlocalizedName().subString(5)+"_" + type*);
getUnlocalizedName() revoie “tile.” + le nom non localisé.
-
Merci ! Je n’avais pas vu que tu avais deja rajouté le subString(5), je l’ai fait automatiquement par moi même, merci encore, je ne pensais pas que getUnlocalizedName() renvoie le tile. avec Merci, d’avoir répondu si vite, et de m’avoir tout de même un code que j’ai suivi inconsciemment