Créer un arbre
-
Moi j’essaye de faire un arbre avec le meme tuto mais je n’y arrive pas
-
Bonjour, je n’arrive bizarrement pas à obtenir la texture de mes feuilles alors que j’ai celle du bois et de la pousse
Voici ma classe feuille :
package com.google.phoenix.d.rebirth.bamboo.common; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.BlockLeaves; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BambooFeuilles extends BlockLeaves { @Override public IIcon getIcon(int var1, int var2) { return null; } @Override public String[] func_150125_e() { return null; } protected IIcon fastIcon; @Override public void registerBlockIcons(IIconRegister iconregister) { blockIcon = iconregister.registerIcon(this.getTextureName()); fastIcon = iconregister.registerIcon(this.getTextureName() + "_opaque"); } @Override public boolean isOpaqueCube() { return Blocks.leaves.isOpaqueCube(); } @Override public boolean isLeaves(IBlockAccess world, int x, int y, int z) { return true; } @SideOnly(Side.CLIENT) public boolean shouldSideBeRendered(IBlockAccess blockaccess, int x, int y, int z, int side) { return !this.isOpaqueCube() ? true : super.shouldSideBeRendered(blockaccess, x, y, z, side); } @Override public int getBlockColor() { return -1; } @Override public int getRenderColor(int par1) { return -1; } @Override public int quantityDropped(Random random) { return random.nextInt(20) == 0 ? 1 : 0; } @Override public Item getItemDropped(int metadata, Random random, int par3) { return Item.getItemFromBlock(BambooMod.bambooPousse); } @Override public void dropBlockAsItemWithChance(World world, int x, int y, int z, int metadata, float par6, int par7) { if(!world.isRemote) { if(world.rand.nextInt(20) == 0) { Item splingid = this.getItemDropped(metadata, world.rand, par7); this.dropBlockAsItem(world, x, y, z, new ItemStack(splingid, 1, this.damageDropped(metadata))); } } } }
et le code de ma classe principale :
package com.google.phoenix.d.rebirth.bamboo.common; import com.google.phoenix.d.rebirth.bamboo.proxy.CommonProxy; import cpw.mods.fml.common.IWorldGenerator; 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.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; 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.oredict.OreDictionary; @Mod(modid = "bamboomod", name = "bamboomod", version = "1.7.10") public class BambooMod { @Instance("bamboomod") public static BambooMod instance; public static final String MODID = "bamboomod"; public static Item item1, helmetitem, chestplateitem, leggingsitem, bootsitem, sworditem, pickaxeitem, axeitem, shovelitem, hoeitem; public static ArmorMaterial bambooArmor = EnumHelper.addArmorMaterial("bambooArmor", 10, new int[] {2, 7, 5, 2}, 11); public static ToolMaterial bambooTool = EnumHelper.addToolMaterial("bambooTool", 2, 899, 12.0F, 2.5F, 20); public static Block bambooBlock, bambooBois, bambooFeuilles, bambooPousse; public static CreativeTabs BambooCreativeTabs = new BambooCreativeTabs("bamboo_creative_tabs"); WorldGeneration worldgeneration = new WorldGeneration(); @SidedProxy(clientSide = "com.google.phoenix.d.rebirth.bamboo.proxy.ClientProxy", serverSide = "com.google.phoenix.d.rebirth.bamboo.proxy.CommonProxy") public static CommonProxy proxy; @EventHandler public void preInit(FMLPreInitializationEvent event) { item1 = new Item1().setUnlocalizedName("item1").setTextureName(BambooMod.MODID + ":item1").setCreativeTab(CreativeTabs.tabMaterials); helmetitem = new ItemArmorBamboo(bambooArmor, 0).setUnlocalizedName("helmetitem").setTextureName(BambooMod.MODID + ":helmet_item").setCreativeTab(CreativeTabs.tabCombat); chestplateitem = new ItemArmorBamboo(bambooArmor, 1).setUnlocalizedName("chestplateitem").setTextureName(BambooMod.MODID + ":chestplate_item").setCreativeTab(CreativeTabs.tabCombat); leggingsitem = new ItemArmorBamboo(bambooArmor, 2).setUnlocalizedName("leggingsitem").setTextureName(BambooMod.MODID + ":leggings_item").setCreativeTab(CreativeTabs.tabCombat); bootsitem = new ItemArmorBamboo(bambooArmor, 3).setUnlocalizedName("bootsitem").setTextureName(BambooMod.MODID + ":boots_item").setCreativeTab(CreativeTabs.tabCombat); sworditem = new ItemBambooSword(bambooTool).setUnlocalizedName("sworditem").setTextureName(BambooMod.MODID + ":sword_item").setCreativeTab(CreativeTabs.tabCombat); pickaxeitem = new ItemBambooPickaxe(bambooTool).setUnlocalizedName("pickaxeitem").setTextureName(BambooMod.MODID + ":pickaxe_item").setCreativeTab(CreativeTabs.tabTools); axeitem = new ItemBambooAxe(bambooTool).setUnlocalizedName("axeitem").setTextureName(BambooMod.MODID + ":axe_item").setCreativeTab(CreativeTabs.tabTools); shovelitem = new ItemBambooSpade(bambooTool).setUnlocalizedName("shovelitem").setTextureName(BambooMod.MODID + ":shovel_item").setCreativeTab(CreativeTabs.tabTools); hoeitem = new ItemBambooHoe(bambooTool).setUnlocalizedName("hoeitem").setTextureName(BambooMod.MODID + ":hoe_item").setCreativeTab(CreativeTabs.tabTools); bambooBlock = new BambooBlock(Material.rock).setHardness(3.0F).setBlockName("bambooore").setBlockTextureName(BambooMod.MODID+":bambooore_block").setCreativeTab(CreativeTabs.tabBlock); bambooBois = new BambooBois().setBlockName("Bamboo_wood").setBlockTextureName(BambooMod.MODID+":Bamboo_wood"); bambooFeuilles = new BambooFeuilles().setBlockName("Bamboo_leaves").setBlockTextureName(BambooMod.MODID+":Bamboo_leaves"); bambooPousse = new BambooPousse().setBlockName("Bamboo_sapling").setBlockTextureName(BambooMod.MODID+":Bamboo_sapling"); OreDictionary.registerOre("ingotBamboo", item1); GameRegistry.registerItem(item1, "Bamboo_ingot"); GameRegistry.registerItem(helmetitem, "helmet_item"); GameRegistry.registerItem(chestplateitem, "chestplate_item"); GameRegistry.registerItem(leggingsitem, "leggings_item"); GameRegistry.registerItem(bootsitem, "boots_item"); GameRegistry.registerItem(sworditem, "sword_item"); GameRegistry.registerItem(pickaxeitem, "pickaxe_item"); GameRegistry.registerItem(axeitem, "axe_item"); GameRegistry.registerItem(shovelitem, "shovel_item"); GameRegistry.registerItem(hoeitem, "hoe_item"); GameRegistry.registerBlock(bambooBlock, "bambooore_block"); GameRegistry.registerBlock(bambooBois , "Bamboo_wood"); GameRegistry.registerBlock(bambooFeuilles , "Bamboo_leaves"); GameRegistry.registerBlock(bambooPousse, "Bamboo_sapling"); GameRegistry.addSmelting(bambooBlock, new ItemStack(item1), 1); GameRegistry.registerWorldGenerator(worldgeneration, 0); GameRegistry.addRecipe(new ItemStack(helmetitem), new Object[]{ "XXX", "X X", 'X', BambooMod.item1, }); GameRegistry.addRecipe(new ItemStack(chestplateitem), new Object[]{ "X X", "XXX", "XXX", 'X', BambooMod.item1, }); GameRegistry.addRecipe(new ItemStack(leggingsitem), new Object[]{ "XXX", "X X", "X X", 'X', BambooMod.item1, }); GameRegistry.addRecipe(new ItemStack(bootsitem), new Object[]{ "X X", "X X", 'X', BambooMod.item1, }); GameRegistry.addRecipe(new ItemStack(sworditem), new Object[]{ "X", "X", "Y", 'X', BambooMod.item1, 'Y', Items.stick , }); GameRegistry.addRecipe(new ItemStack(shovelitem), new Object[]{ "X", "Y", "Y", 'X', BambooMod.item1, 'Y', Items.stick , }); GameRegistry.addRecipe(new ItemStack(pickaxeitem), new Object[]{ "XXX", " Y ", " Y ", 'X', BambooMod.item1, 'Y', Items.stick , }); GameRegistry.addRecipe(new ItemStack(axeitem), new Object[]{ "XX", "XY", " Y", 'X', BambooMod.item1, 'Y', Items.stick , }); GameRegistry.addRecipe(new ItemStack(hoeitem), new Object[]{ "XX", " Y", " Y", 'X', BambooMod.item1, 'Y', Items.stick , }); } @EventHandler public void init(FMLInitializationEvent event) { proxy.registerRender(); MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
Je n’arrive pas à générer les arbres dans la dimension également et je vous en ferai part une fois que la texture sera apparente ^^
-
@robin4002 tu saurais ? ( désolé de te solliciter pas mal mais je vois que tu es bien actif et compétent ^^')
-
Non, j’aurai déjà répondu si j’avais une réponse à apporter (je lis tous les messages du forum).
-
ah ok ^^ désolé du dérangement dans ce cas ^^
-
j’ai testé en prenant les textures 1.7.10 des feuilles d’oak (qui sont en noir et blanc pour une raison que j’ignore btw) et la texture ne s’implémente toujours pas
-
Ce message a été supprimé ! -
Ce message a été supprimé ! -
Ce message a été supprimé !