Modele techne invisible
-
bonjour à tous
je tente de d’importer un bloc tout bête fait sous techne ( je fais simple pour commencer ! ) mais il n’apparait pas, je ne vois que la hitbox. le bloc se pose et se détruit, mais on dirait qu’il y a un probleme de texture. j’ai suivi le tuto de 00miah00 ( http://www.youtube.com/watch?v=VJeXlVmJ3Wc&hd=1 ) que j’ai trouve tres bien fait. je lui ai envoyé des messages, sans réponse.
je vous poste mes codes :la classe principale generic
package tutorial.generic; // This Import list will grow longer with each additional tutorial. // It's not pruned between full class postings, unlike other tutorial code. import CommonProxy.CommonProxy; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.block.material.Material; import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.MinecraftForge; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PostInit; import cpw.mods.fml.common.Mod.PreInit; 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.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="generic", name="Generic", version="0.0.0") @NetworkMod(clientSideRequired=true, serverSideRequired=false) public class Generic { // See Basic items tutorial for Generic Ingot private static Item genericItem; public static Item genericIngot; public static Block genericDirt; public static Block genericOre; public static Block fullcube; @Instance(value="generic") public static Generic instance; @SidedProxy(clientSide="tutorial.generic.client.ClientProxy", serverSide="tutorial.generic.CommonProxy") public static CommonProxy proxy; // !!!!!! PREINIT !!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!! @EventHandler public void preInit(FMLPreInitializationEvent event) { // GENERICITEM genericItem = new GenericItem(5000); genericIngot = new GenericItem(5001) .setMaxStackSize(16) .setUnlocalizedName("specificitem"); //GENERICDIRT genericDirt = new GenericBlock(500, Material.ground) .setHardness(0.5F) .setStepSound(Block.soundGravelFootstep) .setUnlocalizedName("genericDirt") .setCreativeTab(CreativeTabs.tabBlock) .setTextureName("genericmod:genericdirt"); GameRegistry.registerBlock(genericDirt, "genericDirt"); //avec quoi on la recolte MinecraftForge.setBlockHarvestLevel(genericDirt, "shovel", 0); //GENERICORE genericOre = new GenericOre(501,Material.rock); // See Basic items tutorial for Generic Ingot GameRegistry.registerBlock(genericOre, "genericOre"); //avec quoi on la recolte MinecraftForge.setBlockHarvestLevel(genericOre, "pickaxe", 3); //FULLCUBE fullcube = new fullcube(810) .setTextureName("generic:fullcube") .setUnlocalizedName("fullcube"); GameRegistry.registerBlock(fullcube, "fullcube"); GameRegistry.registerTileEntity(entityfullcube.class,"fullcube"); // j'ai eu un probleme avec registerTileEntity, j'ai été obligé de //creer une méthode dans net.minecraft.src;ModLoader. est-ce correct ? proxy.registerTileRenders(); proxy.registerRenderers(); proxy.registerTileEntityRender(); } private Block setMaxStackSize(int i) { // TODO Auto-generated method stub return null; } // !!!!!! LOAD !!!!!!! //!!!!!!!!!!!!!!!!!!!!!!!!!!!! @EventHandler public void load(FMLInitializationEvent event) { // afficher le nom dans l'inventaire LanguageRegistry.addName(genericItem, "Generic Item"); // afficher les noms dans l'inventaire LanguageRegistry.addName(genericIngot, "Generic Ingot"); //instance ??? LanguageRegistry.instance().addStringLocalization("en_US", "Generic Ingot"); // afficher le nom dans l'inventaire LanguageRegistry.addName(genericDirt, "Generic Dirt"); //instance ??? LanguageRegistry.instance().addStringLocalization("en_US", "Generic Dirt"); // afficher le nom dans l'inventaire LanguageRegistry.addName(genericOre, "Generic Ore"); // afficher le nom dans l'inventaire LanguageRegistry.addName(fullcube,"fullcube"); } @EventHandler public void postInit(FMLPostInitializationEvent event) { // Stub Method } }
la classe du bloc fullcube
package tutorial.generic; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class fullcube extends BlockContainer { //Treat it like a normal block here. The Block Bounds are a good idea - the first three are X Y and Z of the botton-left corner, //And the second three are the top-right corner. public fullcube(int id) { super(id, Material.iron); this.setCreativeTab(CreativeTabs.tabBlock); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1F, 1F, 1F); } //Make sure you set this as your TileEntity class relevant for the block! @Override public TileEntity createNewTileEntity(World world) { return new entityfullcube(); } //You don't want the normal render type, or it wont render properly. @Override public int getRenderType() { return -1; } //It's not an opaque cube, so you need this. @Override public boolean isOpaqueCube() { return false; } //It's not a normal block, so you need this too. public boolean renderAsNormalBlock() { return false; } //This is the icon to use for showing the block in your hand. public void registerIcons(IconRegister icon) { this.blockIcon = icon.registerIcon("generic:fullcube.png"); } }
renderfullcube
package tutorial.generic; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; public class rendufullcube extends TileEntitySpecialRenderer { private final modelfullcube rendu; protected static final ResourceLocation texture = new ResourceLocation("generic:fullcube.png"); public rendufullcube() { this.rendu = new modelfullcube(); } private void adjustRotatePivotViaMeta(World world, int x, int y, int z) { int meta = world.getBlockMetadata(x, y, z); GL11.glPushMatrix(); GL11.glRotatef(meta * (-90), 0.0F, 0.0F, 1.0F); GL11.glPopMatrix(); } @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) { GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y +0.5F, (float) z + 0.5F); this.func_110628_a(texture); //this.bindTexture(texture); //ResourceLocation texture = (new ResourceLocation("generic:textures/blocks/fullcube.png")); Minecraft.getMinecraft().renderEngine.bindTexture(texture); GL11.glPushMatrix(); GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); this.rendu.render((Entity)null, 0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); GL11.glPopMatrix(); GL11.glPopMatrix(); } private void func_110628_a(ResourceLocation texture2) { // TODO Auto-generated method stub } private void adjustLightFixture(World world, int i, int j, int k, Block block) { Tessellator tess = Tessellator.instance; float brightness = block.getBlockBrightness(world, i, j, k); int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0); int modulousModifier = skyLight % 65536; int divModifier = skyLight / 65536; tess.setColorOpaque_F(brightness, brightness, brightness); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float) modulousModifier, divModifier); } }
modelfullcube
package tutorial.generic; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class modelfullcube extends ModelBase { //fields ModelRenderer Shape1; public modelfullcube() { textureWidth = 32; textureHeight = 32; Shape1 = new ModelRenderer(this, 0, 0); Shape1.addBox(0F, 0F, 0F, 16, 16, 16); Shape1.setRotationPoint(-8F, 8F, -8F); Shape1.setTextureSize(32, 32); Shape1.mirror = true; setRotation(Shape1, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5,entity); Shape1.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5,Entity entity) { super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); } }
entityfullcube
package tutorial.generic; import net.minecraft.tileentity.TileEntity; public class entityfullcube extends TileEntity { }
le client proxy
package tutorial.generic.client; import tutorial.generic.entityfullcube; import tutorial.generic.rendufullcube; import CommonProxy.CommonProxy; import cpw.mods.fml.client.registry.ClientRegistry; public class ClientProxy extends CommonProxy { @Override public void registerRenderers(){ ClientRegistry.bindTileEntitySpecialRenderer(entityfullcube.class, new rendufullcube());{ // This is for rendering entities and so forth later on } } }
et les codes d’erreur
janv. 19, 2014 2:26:36 AM net.minecraft.launchwrapper.LogWrapper log Infos: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker janv. 19, 2014 2:26:36 AM net.minecraft.launchwrapper.LogWrapper log Infos: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker janv. 19, 2014 2:26:36 AM net.minecraft.launchwrapper.LogWrapper log Infos: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker 2014-01-19 02:26:36 [Infos] [ForgeModLoader] Forge Mod Loader version 6.4.45.953 for Minecraft 1.6.4 loading 2014-01-19 02:26:36 [Infos] [ForgeModLoader] Java is Java HotSpot(TM) 64-Bit Server VM, version 1.7.0_45, running on Windows 8:amd64:6.2, installed at C:\Program Files\Java\jre7 2014-01-19 02:26:36 [Infos] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation 2014-01-19 02:26:36 [Infos] [ForgeModLoader] Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker 2014-01-19 02:26:36 [Infos] [ForgeModLoader] Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker 2014-01-19 02:26:36 [Infos] [ForgeModLoader] Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker 2014-01-19 02:26:36 [Infos] [ForgeModLoader] Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker 2014-01-19 02:26:36 [Infos] [ForgeModLoader] Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper 2014-01-19 02:26:36 [Infos] [STDOUT] Loaded 40 rules from AccessTransformer config file fml_at.cfg 2014-01-19 02:26:36 [Grave] [ForgeModLoader] The binary patch set is missing. Either you are in a development environment, or things are not going to work! 2014-01-19 02:26:37 [Infos] [ForgeModLoader] Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper 2014-01-19 02:26:37 [Infos] [STDOUT] Loaded 110 rules from AccessTransformer config file forge_at.cfg 2014-01-19 02:26:37 [Infos] [ForgeModLoader] Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker 2014-01-19 02:26:37 [Infos] [ForgeModLoader] Launching wrapped minecraft {net.minecraft.client.main.Main} 2014-01-19 02:26:38 [Infos] [Minecraft-Client] Setting user: Player140 2014-01-19 02:26:39 [Infos] [Minecraft-Client] LWJGL Version: 2.9.0 2014-01-19 02:26:39 [Infos] [Minecraft-Client] Reloading ResourceManager: Default 2014-01-19 02:26:40 [Infos] [MinecraftForge] Attempting early MinecraftForge initialization 2014-01-19 02:26:40 [Infos] [STDOUT] MinecraftForge v9.11.1.953 Initialized 2014-01-19 02:26:40 [Infos] [ForgeModLoader] MinecraftForge v9.11.1.953 Initialized 2014-01-19 02:26:40 [Infos] [STDOUT] Replaced 112 ore recipies 2014-01-19 02:26:40 [Infos] [MinecraftForge] Completed early MinecraftForge initialization 2014-01-19 02:26:40 [Infos] [ForgeModLoader] Reading custom logging properties from C:\Users\Caillou-Bourdin\Desktop\forge\mcp\jars\config\logging.properties 2014-01-19 02:26:40 [Désactivé] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL 2014-01-19 02:26:40 [Infos] [ForgeModLoader] Searching C:\Users\Caillou-Bourdin\Desktop\forge\mcp\jars\mods for mods 2014-01-19 02:26:42 [Infos] [ForgeModLoader] Forge Mod Loader has identified 5 mods to load 2014-01-19 02:26:42 [Infos] [mcp] Activating mod mcp 2014-01-19 02:26:42 [Infos] [FML] Activating mod FML 2014-01-19 02:26:42 [Infos] [Forge] Activating mod Forge 2014-01-19 02:26:42 [Infos] [mod_nomdumod] Activating mod mod_nomdumod 2014-01-19 02:26:42 [Infos] [generic] Activating mod generic 2014-01-19 02:26:42 [Avertissement] [Forge Mod Loader] Mod Forge Mod Loader is missing a pack.mcmeta file, things may not work well 2014-01-19 02:26:42 [Avertissement] [Minecraft Forge] Mod Minecraft Forge is missing a pack.mcmeta file, things may not work well 2014-01-19 02:26:42 [Avertissement] [Generic] Mod Generic is missing a pack.mcmeta file, things may not work well 2014-01-19 02:26:42 [Infos] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Generic 2014-01-19 02:26:42 [Infos] [ForgeModLoader] Registering Forge Packet Handler 2014-01-19 02:26:42 [Infos] [ForgeModLoader] Succeeded registering Forge Packet Handler 2014-01-19 02:26:42 [Infos] [ForgeModLoader] Configured a dormant chunk cache size of 0 2014-01-19 02:26:42 [Grave] [ForgeModLoader] Found anonymous item of class net.minecraft.item.ItemReed with ID 1256 owned by mod mod_nomdumod, this item will NOT survive a 1.7 upgrade! 2014-01-19 02:26:42 [Grave] [ForgeModLoader] Found anonymous item of class tutorial.generic.GenericItem with ID 5256 owned by mod generic, this item will NOT survive a 1.7 upgrade! 2014-01-19 02:26:42 [Grave] [ForgeModLoader] Found anonymous item of class tutorial.generic.GenericItem with ID 5257 owned by mod generic, this item will NOT survive a 1.7 upgrade! 2014-01-19 02:26:42 [Grave] [Minecraft-Client] Using missing texture, unable to load: generic:textures/blocks/fullcube.png.png 2014-01-19 02:26:43 [Grave] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/blocks/MISSING_ICON_TILE_205_nomdubloc.png 2014-01-19 02:26:43 [Grave] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_1256_nomdelitem.png 2014-01-19 02:26:43 [Infos] [ForgeModLoader] Forge Mod Loader has successfully loaded 5 mods 2014-01-19 02:26:43 [Avertissement] [Forge Mod Loader] Mod Forge Mod Loader is missing a pack.mcmeta file, things may not work well 2014-01-19 02:26:43 [Avertissement] [Minecraft Forge] Mod Minecraft Forge is missing a pack.mcmeta file, things may not work well 2014-01-19 02:26:43 [Avertissement] [Generic] Mod Generic is missing a pack.mcmeta file, things may not work well 2014-01-19 02:26:43 [Infos] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:Generic 2014-01-19 02:26:43 [Grave] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_1256_nomdelitem.png 2014-01-19 02:26:43 [Grave] [Minecraft-Client] Using missing texture, unable to load: generic:textures/blocks/fullcube.png.png 2014-01-19 02:26:43 [Grave] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/blocks/MISSING_ICON_TILE_205_nomdubloc.png 2014-01-19 02:26:43 [Infos] [STDOUT] 2014-01-19 02:26:43 [Infos] [STDOUT] Starting up SoundSystem… 2014-01-19 02:26:43 [Infos] [STDOUT] Initializing LWJGL OpenAL 2014-01-19 02:26:43 [Infos] [STDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) 2014-01-19 02:26:44 [Infos] [STDOUT] OpenAL initialized. 2014-01-19 02:26:44 [Infos] [STDOUT] 2014-01-19 02:26:44 [Grave] [Minecraft-Client] Realms: Invalid session id 2014-01-19 02:26:47 [Infos] [Minecraft-Server] Starting integrated minecraft server version 1.6.4 2014-01-19 02:26:47 [Infos] [Minecraft-Server] Generating keypair 2014-01-19 02:26:47 [Infos] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.server.integrated.IntegratedServer@4980c2b4) 2014-01-19 02:26:47 [Infos] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.server.integrated.IntegratedServer@4980c2b4) 2014-01-19 02:26:47 [Infos] [ForgeModLoader] Loading dimension -1 (New World) (net.minecraft.server.integrated.IntegratedServer@4980c2b4) 2014-01-19 02:26:47 [Infos] [Minecraft-Server] Preparing start region for level 0 2014-01-19 02:26:48 [Infos] [STDOUT] loading single player 2014-01-19 02:26:48 [Infos] [Minecraft-Server] Player140[/127.0.0.1:0] logged in with entity id 44 at (127.94693698670528, 4.0, 310.5540665551132) 2014-01-19 02:26:48 [Infos] [Minecraft-Server] Player140 joined the game 2014-01-19 02:26:48 [Infos] [STDOUT] Setting up custom skins 2014-01-19 02:26:49 [Avertissement] [Minecraft-Client] Failed to load texture: generic:fullcube.png java.io.FileNotFoundException: generic:fullcube.png at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:31) at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:84) at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:41) at tutorial.generic.rendufullcube.renderTileEntityAt(rendufullcube.java:39) at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:172) at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntity(TileEntityRenderer.java:157) at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:536) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1160) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1006) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946) at net.minecraft.client.Minecraft.run(Minecraft.java:838) at net.minecraft.client.main.Main.main(Main.java:93) 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:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2014-01-19 02:26:52 [Infos] [Minecraft-Server] Saving and pausing game… 2014-01-19 02:26:52 [Infos] [Minecraft-Server] Saving chunks for level 'New World'/Overworld 2014-01-19 02:26:52 [Infos] [Minecraft-Server] Saving chunks for level 'New World'/Nether 2014-01-19 02:26:52 [Infos] [Minecraft-Server] Saving chunks for level 'New World'/The End 2014-01-19 02:26:54 [Infos] [Minecraft-Client] Stopping! 2014-01-19 02:26:54 [Infos] [STDOUT] 2014-01-19 02:26:54 [Infos] [STDOUT] SoundSystem shutting down… 2014-01-19 02:26:54 [Infos] [Minecraft-Server] Stopping server 2014-01-19 02:26:54 [Infos] [Minecraft-Server] Saving players 2014-01-19 02:26:54 [Infos] [Minecraft-Server] Player140 left the game 2014-01-19 02:26:54 [Infos] [Minecraft-Server] Saving worlds 2014-01-19 02:26:54 [Infos] [Minecraft-Server] Saving chunks for level 'New World'/Overworld 2014-01-19 02:26:54 [Infos] [Minecraft-Server] Saving chunks for level 'New World'/Nether 2014-01-19 02:26:54 [Infos] [Minecraft-Server] Saving chunks for level 'New World'/The End 2014-01-19 02:26:54 [Infos] [ForgeModLoader] Unloading dimension 0 2014-01-19 02:26:54 [Infos] [ForgeModLoader] Unloading dimension -1 2014-01-19 02:26:54 [Infos] [ForgeModLoader] Unloading dimension 1 2014-01-19 02:26:54 [Infos] [STDOUT] Author: Paul Lamb, www.paulscode.com 2014-01-19 02:26:54 [Infos] [STDOUT] 2014-01-19 02:26:54 [Infos] [Minecraft-Server] Stopping server 2014-01-19 02:26:54 [Infos] [Minecraft-Server] Saving players 2014-01-19 02:26:54 [Infos] [Minecraft-Server] Saving worlds
merci d’avance
-
Dans ta classe principale, il te manque proxy.registerRenderers(); dans ta fonction init, et ta texture n’est pas trouvé elle surement au mauvais endroit.
Et sinon il y a un tutoriel plus poussé concernant les rendus TESR sur notre forum qui prend en compte le rendu en main :
http://www.minecraftforgefrance.fr/showthread.php?tid=127 -
merci de ta reponse, robin.
j’ai vérifié, j’ai bien proxy.registerRenderers(); dans la fonction public void preinit ( ligne 97 actuellement ). peut-être est il mal placé ? ( je débute en java).
les textures sont dans le dossier suivant : Desktop\forge\mcp\src\minecraft\assets\genericmod\textures\blocks. est ce correct ?
j’ai déjà regardé le tutoriel sur les TESR, mais j’ai un peu du mal à le comprendre, il y a des codes que je ne sais pas vraiment où placer. est il valable pour la version de forge 9.11.1.953 ?
j’ai déjà discuté un peu avec Superloup10 qui m’a conseillé de m’adreser à toi pour résoudre mes problèmes.
-
Oui, il est valable pour forge 953. Il faut bien suivre les instructions et pas seulement copier les codes, et tu devrais y arriver. Regarde bien aussi tout les prérequis, si tu ne les suis pas il va te manquer des classes.
Et non, ton emplacement de texture n’est pas bon, si tu veux utiliser cette emplacement utilise ce resourcelocation :
protected static final ResourceLocation texture = new ResourceLocation(“generic:textures/blocks/fullcube.png”);
-
j’ai remis (“generic:textures/blocks/fullcube.png”); mais ça ne marche toujours pas. je ne comprends pas pourquoi pour les autres blocs “normaux” .setTextureName(“genericmod:genericdirt”); fonctionne et qu’il faut un code différent pour fullcube.
que dois-je penser de ces avertissements ? sont-ils la source de mon probleme ?
2014-01-21 10:11:22 [Avertissement] [Forge Mod Loader] Mod Forge Mod Loader is missing a pack.mcmeta file, things may not work well
2014-01-21 10:11:22 [Avertissement] [Minecraft Forge] Mod Minecraft Forge is missing a pack.mcmeta file, things may not work well
2014-01-21 10:11:22 [Avertissement] [Generic] Mod Generic is missing a pack.mcmeta file, things may not work wellj’ai aussi cette ligne qui concerne clairement mon bloc fullcube :
2014-01-21 10:11:22 [Grave] [Minecraft-Client] Unable to parse animation metadata from genericmod:textures/blocks/fullcube.png: broken aspect ratio and not an animationc’est vrai que pour l’instant je me contente de copier des bouts de code et que je ne comprends pas tout ce que je tape, mais j’ai pourtant réussi à créer des blocs “normaux” qui fonctionnent.
je commence à essayer d’inserer les codes du tuto de kevin. j’avoue que je ne me suis pas encore “collé” le tile entity, ça me semble vraiment tres complexe!…
bon allez je m’y colle
merci pour ta patience
-
2014-01-21 10:11:22 [Avertissement] [Forge Mod Loader] Mod Forge Mod Loader is missing a pack.mcmeta file, things may not work well
2014-01-21 10:11:22 [Avertissement] [Minecraft Forge] Mod Minecraft Forge is missing a pack.mcmeta file, things may not work well
2014-01-21 10:11:22 [Avertissement] [Generic] Mod Generic is missing a pack.mcmeta file, things may not work wellC’est normal, les mods sont considérés par Minecraft comme étant des RessourcesPacks.
-
@‘kristiensen’:
j’ai remis (“generic:textures/blocks/fullcube.png”); mais ça ne marche toujours pas. je ne comprends pas pourquoi pour les autres blocs “normaux” .setTextureName(“genericmod:genericdirt”); fonctionne et qu’il faut un code différent pour fullcube.
Car lorsque tu créés un bloc normal, le setTextureName défini juste une variable au bloc, ensuite la fonction des renders blocs le créé automatiquement un resourceLocation avec genericmod:textures/blocks/genericdirt.png
Lorsqu’on créer un resourceLocation, il faut mettre le chemin entier.
@‘kristiensen’:
2014-01-21 10:11:22 [Grave] [Minecraft-Client] Unable to parse animation metadata from genericmod:textures/blocks/fullcube.png: broken aspect ratio and not an animation
Ta texture a un problème. Quel est ça taille ? La taille du modèle est bien identique ? As-tu mit un fichier du même nom avec l’extension .mcdata ?
-
donc pour les avertissements sur le packs mcmeta pas d’affolement, si je comprends bien , c’est normal ?
ok pour les resourceLocation
effectivement j’ai voulu créer un bloc de 14x14x14, je me disais que ça buggait peut-être de faire un bloc normal de 16x16x16, la texture est de la bonne taille puisque générée par techne,(c’est la texture par défaut de techne) mais je n’avais pas corrigé les texturewidth et textureheight. c’est chose faite et… ça na marche pas. j’ai toujours Unable to parse animation. est-ce que je DOIS avoir un un fichier du même nom avec l’extension .mcdata ?
je trouve une autre erreur en epluchant la console : [Grave] [ForgeModLoader] A TileEntity type tutorial.generic.entityfullcube has throw an exception trying to write state. It will not persist. Report this to the mod author
java.lang.RuntimeException: class tutorial.generic.entityfullcube is missing a mapping! This is a bug! y aurait il un truc pourri dans mon tile entity ?
donc pas la peine de s’affoler pour les pack.mcmeta ? c’est normal ?
ok pour resourceLocation
j’ai toujours un gros doute sur le chemin de la texture. super loup me dit que le chemin correct est generic:textures/blocks/fullcube.png. pourtant le package de textures s’appelle assets.genericmod.textures.blocks. quand je le renomme le chemin generic:textures/blocks/fullcube.png, j’ai le droit à tout un tas d’erreur que je n’ai pas avec l’autre nom de chemin genericmod:textures/blocks/fullcube.png:
[Avertissement] [Minecraft-Client] Failed to load texture: generic:textures/blocks/fullcube.png java.io.FileNotFoundException: generic:textures/blocks/fullcube.png at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:31) at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:84) at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:41) at tutorial.generic.rendufullcube.renderTileEntityAt(rendufullcube.java:40) at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:172) at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntity(TileEntityRenderer.java:157) at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:536) at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1160) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1006) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946) at net.minecraft.client.Minecraft.run(Minecraft.java:838) at net.minecraft.client.main.Main.main(Main.java:93) 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:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) ```___ j'avais effectivement un souci avec la taille de la texture, j'ai fabriqué sous techne un cube de 14x14x14 car je me disais qu'un cube de 16x16x16 buggait peut etre. j'ai remis les choses en ordre, en particulier les textureheight et texturewidth qui sont maintenant de multipes de 14\. mais… toujours pareil !
-
Dans ta classe principale, tu dois enregistrer ton tile entity, il faut bien suivre le tutoriel c’est écrit ! (GameRegistry.registerTileEntity(TonTileEntity.class, “nom”); dans la fonction init).
Pour le problème de texture, envoie ta texture ainsi que le modèle techne exporté en java.
Et oui, ne t’affole pas pour le pack.mcdata, c’est normal.
Et non, pas besoin de mcdata pour la texture du bloc techne. -
je te joins l’export techne et la texture ( tu vas voir, c’est basique ! )