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; |
| |
| |
| |
| |
| 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 |
| { |
| |
| 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; |
| |
| |
| |
| @EventHandler |
| public void preInit(FMLPreInitializationEvent event) |
| |
| { |
| genericItem = new GenericItem(5000); |
| genericIngot = new GenericItem(5001) |
| .setMaxStackSize(16) |
| .setUnlocalizedName("specificitem"); |
| |
| |
| genericDirt = new GenericBlock(500, Material.ground) |
| .setHardness(0.5F) |
| .setStepSound(Block.soundGravelFootstep) |
| .setUnlocalizedName("genericDirt") |
| .setCreativeTab(CreativeTabs.tabBlock) |
| .setTextureName("genericmod:genericdirt"); |
| GameRegistry.registerBlock(genericDirt, "genericDirt"); |
| |
| MinecraftForge.setBlockHarvestLevel(genericDirt, "shovel", 0); |
| |
| |
| genericOre = new GenericOre(501,Material.rock); |
| |
| GameRegistry.registerBlock(genericOre, "genericOre"); |
| |
| MinecraftForge.setBlockHarvestLevel(genericOre, "pickaxe", 3); |
| |
| |
| fullcube = new fullcube(810) |
| .setTextureName("generic:fullcube") |
| .setUnlocalizedName("fullcube"); |
| GameRegistry.registerBlock(fullcube, "fullcube"); |
| GameRegistry.registerTileEntity(entityfullcube.class,"fullcube"); |
| |
| |
| |
| proxy.registerTileRenders(); |
| |
| proxy.registerRenderers(); |
| |
| proxy.registerTileEntityRender(); |
| |
| } |
| private Block setMaxStackSize(int i) { |
| |
| return null; |
| } |
| |
| |
| @EventHandler |
| public void load(FMLInitializationEvent event) { |
| |
| LanguageRegistry.addName(genericItem, "Generic Item"); |
| |
| LanguageRegistry.addName(genericIngot, "Generic Ingot"); |
| |
| LanguageRegistry.instance().addStringLocalization("en_US", "Generic Ingot"); |
| |
| LanguageRegistry.addName(genericDirt, "Generic Dirt"); |
| |
| LanguageRegistry.instance().addStringLocalization("en_US", "Generic Dirt"); |
| |
| LanguageRegistry.addName(genericOre, "Generic Ore"); |
| |
| LanguageRegistry.addName(fullcube,"fullcube"); |
| |
| } |
| |
| @EventHandler |
| public void postInit(FMLPostInitializationEvent event) { |
| |
| } |
| |
| } |
| |
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 { |
| |
| |
| |
| public fullcube(int id) { |
| super(id, Material.iron); |
| this.setCreativeTab(CreativeTabs.tabBlock); |
| this.setBlockBounds(0.0F, 0.0F, 0.0F, 1F, 1F, 1F); |
| } |
| |
| |
| @Override |
| public TileEntity createNewTileEntity(World world) { |
| return new entityfullcube(); |
| } |
| |
| |
| @Override |
| public int getRenderType() { |
| return -1; |
| } |
| |
| |
| @Override |
| public boolean isOpaqueCube() { |
| return false; |
| } |
| |
| |
| public boolean renderAsNormalBlock() { |
| return false; |
| } |
| |
| |
| 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); |
| |
| |
| 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) { |
| |
| |
| } |
| 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 |
| { |
| |
| 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());{ |
| |
| } |
| |
| } |
| } |
| |
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