Résolu Porte
-
çà viens de tes crafts, pas du block. Envoi ta classe principale.
-
Voici ma class principal
package fr.minecraftforgefrance.novamine.common; import net.minecraft.block.Block; import net.minecraft.block.BlockGlowstone; import net.minecraft.block.BlockOre; 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.ItemDoor; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; 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 fr.minecraftforgefrance.novamine.proxy.CommonProxy; @Mod(modid = "modnovamine", name = "Mod Novamine", version = "1.0.0") public class ModNovamine { public static final String MODID = "modnovamine"; public static final String MODNAME = "Mod Novamine"; public static final String MODVERSION = "1.0.0"; @SidedProxy(clientSide = "fr.minecraftforgefrance.novamine.proxy.ClientProxy", serverSide = "fr.minecraftforgefrance.novamine.proxy.CommonProxy") public static CommonProxy proxy; @Instance("modnovamine") public static ModNovamine instance; public static Block porte; public static Item porteItem; public static Item itemEmerald, helmetEmerald, chestPlateEmerald, leggingsEmerald, bootsEmerald, swordEmerald, pickaxeEmerald, axeEmerald, shovelEmerald, hoeEmerald; public static Item itemNova, helmetNova, chestPlateNova, leggingsNova, bootsNova, swordNova, pickaxeNova, axeNova, shovelNova, hoeNova; public static Item itemSaphir, helmetSaphir, chestPlateSaphir, leggingsSaphir, bootsSaphir, swordSaphir, pickaxeSaphir, axeSaphir, shovelSaphir, hoeSaphir; public static Block invi, invil, Nova, LA, BlockSaphir; public static CreativeTabs Nova1_8 = new Nova1_8("Nova1_8"); public static CreativeTabs BlockNovaMine = new Nova1_8("BlockNovaMine"); public static CreativeTabs ItemNovaMine = new Nova1_8("ItemNovaMine"); public static CreativeTabs ArmurNovaMine = new Nova1_8("ArmurNovaMine"); public static ArmorMaterial armorNova = EnumHelper.addArmorMaterial("armorNova", 25, new int[] {4, 6, 5, 4}, 20); public static ArmorMaterial armorEmerald = EnumHelper.addArmorMaterial("armorEmerald", 50, new int[] {4, 9, 7, 4}, 30); public static ArmorMaterial armorSaphir = EnumHelper.addArmorMaterial("armorSaphir", 60, new int[] {5, 10, 8, 5}, 35); public static ToolMaterial toolNova = EnumHelper.addToolMaterial("toolNova", 2, 854, 12.0F, 4.0F, 18); public static ToolMaterial toolEmerald = EnumHelper.addToolMaterial("toolEmerald", 4, 2000, 10.0F, 4.0F, 18); public static ToolMaterial toolSaphir = EnumHelper.addToolMaterial("toolSaphir", 5, 2400, 10.0F, 5.0F, 19); /** Tool Armor WOOD(0, 59, 2.0F, 0.0F, 15), CLOTH(5, new int[]{1, 3, 2, 1}, 15), STONE(1, 131, 4.0F, 1.0F, 5), CHAIN(15, new int[]{2, 5, 4, 1}, 12), IRON(2, 250, 6.0F, 2.0F, 14), IRON(15, new int[]{2, 6, 5, 2}, 9), EMERALD(3, 1561, 8.0F, 3.0F, 10), GOLD(7, new int[]{2, 5, 3, 1}, 25), DIAMOND(33, new int[]{3, 8, 6, 3}, 10); */ @EventHandler public void preInit(FMLPreInitializationEvent event) { invi = new BlockInvisible(Material.rock).setBlockName("invi").setBlockTextureName(MODID + ":invi").setCreativeTab(BlockNovaMine); invil = new BlockInvisible(Material.rock).setBlockName("invil").setBlockTextureName(MODID + ":invi").setCreativeTab(BlockNovaMine).setLightLevel(1.0F); Nova = new BlockOre().setHardness(3.0F).setResistance(5.0F).setBlockName("oreIron").setBlockTextureName("iron_ore").setCreativeTab(BlockNovaMine).setStepSound(Block.soundTypeStone); LA = new BlockGlowstone(Material.glass).setHardness(0.3F).setStepSound(Block.soundTypeGlass).setLightLevel(1.0F).setBlockName("LA").setBlockTextureName(MODID + ":la").setCreativeTab(Nova1_8); helmetNova = new ItemNovaArmor(armorNova, 0).setUnlocalizedName("helmetTuto").setTextureName(MODID + ":helmet_tutoriel").setCreativeTab(ArmurNovaMine); chestPlateNova = new ItemNovaArmor(armorNova, 1).setUnlocalizedName("chestPlateTuto").setTextureName(MODID + ":chestplate_tutoriel").setCreativeTab(ArmurNovaMine); leggingsNova = new ItemNovaArmor(armorNova, 2).setUnlocalizedName("leggingsTuto").setTextureName(MODID + ":leggings_tutoriel").setCreativeTab(ArmurNovaMine); bootsNova = new ItemNovaArmor(armorNova, 3).setUnlocalizedName("bootsTuto").setTextureName(MODID + ":boots_tutoriel").setCreativeTab(ArmurNovaMine); itemNova = new ItemNova().setUnlocalizedName("tutoriel").setTextureName(MODID + ":item_tutoriel").setCreativeTab(ItemNovaMine).setCreativeTab(ItemNovaMine); swordNova = new ItemNovaSword(toolNova).setUnlocalizedName("swordTuto").setTextureName(MODID + ":sword_tutoriel").setCreativeTab(ItemNovaMine); pickaxeNova = new ItemNovaPickaxe(toolNova).setUnlocalizedName("pickaxeTuto").setTextureName(MODID + ":pickaxe_tutoriel").setCreativeTab(ItemNovaMine); axeNova = new ItemNovaAxe(toolNova).setUnlocalizedName("axeTuto").setTextureName(MODID + ":novahache").setCreativeTab(ItemNovaMine); shovelNova = new ItemNovaShovel(toolNova).setUnlocalizedName("shovelTuto").setTextureName(MODID + ":shovel_tutoriel").setCreativeTab(ItemNovaMine); hoeNova = new ItemNovaHoe(toolNova).setUnlocalizedName("hoeTuto").setTextureName(MODID + ":hoe_tutoriel").setCreativeTab(ItemNovaMine); itemEmerald = new ItemEmerald().setUnlocalizedName("tutoriel").setTextureName(MODID + ":item_tutoriel").setCreativeTab(ItemNovaMine).setCreativeTab(ItemNovaMine); helmetEmerald = new ItemEmeraldArmor(armorEmerald, 0).setUnlocalizedName("helmetEmerald").setTextureName(MODID + ":Emerald_helmet").setCreativeTab(ArmurNovaMine); chestPlateEmerald = new ItemEmeraldArmor(armorEmerald, 1).setUnlocalizedName("chestPlateEmerald").setTextureName(MODID + ":Emerald_chestplate").setCreativeTab(ArmurNovaMine); leggingsEmerald = new ItemEmeraldArmor(armorEmerald, 2).setUnlocalizedName("leggingsEmerald").setTextureName(MODID + ":Emerald_leggings").setCreativeTab(ArmurNovaMine); bootsEmerald = new ItemEmeraldArmor(armorEmerald, 3).setUnlocalizedName("bootsEmerald").setTextureName(MODID + ":Emerald_boots").setCreativeTab(ArmurNovaMine); swordEmerald = new ItemEmeraldSword(toolEmerald).setUnlocalizedName("swordEmerald").setTextureName(MODID + ":Emerald_sword").setCreativeTab(ItemNovaMine); pickaxeEmerald = new ItemEmeraldPickaxe(toolEmerald).setUnlocalizedName("pickaxeEmerald").setTextureName(MODID + ":Emerald_pickaxe").setCreativeTab(ItemNovaMine); axeEmerald = new ItemEmeraldAxe(toolEmerald).setUnlocalizedName("axeEmerald").setTextureName(MODID + ":Emerald_hatchet").setCreativeTab(ItemNovaMine); shovelEmerald = new ItemEmeraldShovel(toolEmerald).setUnlocalizedName("shovelEmerald").setTextureName(MODID + ":Emerald_shovel").setCreativeTab(ItemNovaMine); hoeEmerald = new ItemEmeraldHoe(toolEmerald).setUnlocalizedName("hoeEmerald").setTextureName(MODID + ":Emerald_hoe").setCreativeTab(ItemNovaMine); itemSaphir = new Item().setUnlocalizedName("Saphir").setCreativeTab(ItemNovaMine).setTextureName(MODID + ":Saphir"); helmetSaphir = new ItemSaphirArmor(armorSaphir, 0).setUnlocalizedName("Saphir_helmet").setTextureName(MODID + ":Saphir_helmet").setCreativeTab(ArmurNovaMine); chestPlateSaphir = new ItemSaphirArmor(armorSaphir, 1).setUnlocalizedName("Saphir_chestplate").setTextureName(MODID + ":Saphir_chestplate").setCreativeTab(ArmurNovaMine); leggingsSaphir = new ItemSaphirArmor(armorSaphir, 2).setUnlocalizedName("Saphir_leggings").setTextureName(MODID + ":Saphir_leggings").setCreativeTab(ArmurNovaMine); bootsSaphir = new ItemSaphirArmor(armorSaphir, 3).setUnlocalizedName("Saphir_boots").setTextureName(MODID + ":Saphir_boots").setCreativeTab(ArmurNovaMine); swordSaphir = new ItemSaphirSword(toolSaphir).setUnlocalizedName("Saphir_sword").setTextureName(MODID + ":Saphir_sword").setCreativeTab(ItemNovaMine); pickaxeSaphir = new ItemSaphirPickaxe(toolSaphir).setUnlocalizedName("Saphir_pickaxe").setTextureName(MODID + ":Saphir_pickaxe").setCreativeTab(ItemNovaMine); axeSaphir = new ItemSaphirAxe(toolSaphir).setUnlocalizedName("Saphir_axe").setTextureName(MODID + ":Saphir_axe").setCreativeTab(ItemNovaMine); shovelSaphir = new ItemSaphirShovel(toolSaphir).setUnlocalizedName("Saphir_shovel").setTextureName(MODID + ":Saphir_shovel").setCreativeTab(ItemNovaMine); hoeSaphir = new ItemSaphirHoe(toolSaphir).setUnlocalizedName("Saphir_hoe").setTextureName(MODID + ":Saphir_hoe").setCreativeTab(ItemNovaMine); BlockSaphir = new BlockSaphir (Material.rock).setBlockName("BlockSaphir").setBlockTextureName(MODID + ":Saphir_block").setCreativeTab(BlockNovaMine); porte = new Porte().setBlockName("porte").setBlockTextureName("spruce_upper").setBlockTextureName("spruce_lower"); porteItem = new ItemPorte().setUnlocalizedName("PorteS").setTextureName("spruce"); } @EventHandler public void init(FMLInitializationEvent event) { GameRegistry.registerBlock(porte, "porte"); GameRegistry.registerItem(porteItem, "item_porte"); GameRegistry.registerBlock(invi, "invi"); GameRegistry.registerBlock(invil, "invil"); GameRegistry.registerBlock(Nova, "Nova"); GameRegistry.registerBlock(LA, "LA"); GameRegistry.registerItem(itemNova, "itemNova"); GameRegistry.registerItem(helmetNova, "item_tuto_helmet"); GameRegistry.registerItem(chestPlateNova, "item_tuto_chestplate"); GameRegistry.registerItem(leggingsNova, "item_tuto_leggings"); GameRegistry.registerItem(bootsNova, "item_tuto_boots"); GameRegistry.registerItem(swordNova, "item_tuto_sword"); GameRegistry.registerItem(pickaxeNova, "item_tuto_pickaxe"); GameRegistry.registerItem(axeNova, "item_tuto_axe"); GameRegistry.registerItem(shovelNova, "item_tuto_shovel"); GameRegistry.registerItem(hoeNova, "item_tuto_hoe"); GameRegistry.registerItem(itemEmerald, "itemEmerald"); GameRegistry.registerItem(helmetEmerald, "helmetEmerald"); GameRegistry.registerItem(chestPlateEmerald, "chestPlateEmerald"); GameRegistry.registerItem(leggingsEmerald, "leggingsEmerald"); GameRegistry.registerItem(bootsEmerald, "bootsEmerald"); GameRegistry.registerItem(swordEmerald, "swordEmerald"); GameRegistry.registerItem(pickaxeEmerald, "pickaxeEmerald"); GameRegistry.registerItem(axeEmerald, "axeEmerald"); GameRegistry.registerItem(shovelEmerald, "shovelEmerald"); GameRegistry.registerItem(hoeEmerald, "hoeEmerald"); GameRegistry.registerItem(itemSaphir, "itemSaphir"); GameRegistry.registerItem(helmetSaphir, "helmetSaphir"); GameRegistry.registerItem(chestPlateSaphir, "chestPlateSaphir"); GameRegistry.registerItem(leggingsSaphir, "leggingsSaphir"); GameRegistry.registerItem(bootsSaphir, "bootsSaphir"); GameRegistry.registerItem(swordSaphir, "swordSaphir"); GameRegistry.registerItem(pickaxeSaphir, "pickaxeSaphir"); GameRegistry.registerItem(axeSaphir, "axeSaphir"); GameRegistry.registerItem(shovelSaphir, "shovelSaphir"); GameRegistry.registerItem(hoeSaphir, "hoeSaphir"); GameRegistry.registerBlock(BlockSaphir, "BlockSaphir"); //recette GameRegistry.addRecipe(new ItemStack(swordEmerald, 1), new Object[] { " E ", " E ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(swordEmerald, 1), new Object[] { "E ", "E ", "S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(swordEmerald, 1), new Object[] { " E", " E", " S", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(pickaxeEmerald, 1), new Object[] { "EEE", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(axeEmerald, 1), new Object[] { " EE", " SE", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(axeEmerald, 1), new Object[] { "EE ", "ES ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(shovelEmerald, 1), new Object[] { " E ", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(shovelEmerald, 1), new Object[] { "E ", "S ", "S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(shovelEmerald, 1), new Object[] { " E", " S", " S", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(hoeEmerald, 1), new Object[] { "EE ", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(hoeEmerald, 1), new Object[] { " EE", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(helmetEmerald, 1), new Object[] { "EEE", "E E", " ", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(helmetEmerald, 1), new Object[] { " ", "EEE", "E E", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(chestPlateEmerald, 1), new Object[] { "E E", "EEE", "EEE", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(leggingsEmerald, 1), new Object[] { "EEE", "E E", "E E", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(bootsEmerald, 1), new Object[] { " ", "E E", "E E", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(bootsEmerald, 1), new Object[] { "E E", "E E", " ", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(BlockSaphir, 1), new Object[] { "SSS", "SSS", "SSS", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { " S ", " S ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { "S ", "S ", "0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { " S", " S", " 0", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(pickaxeSaphir, 1), new Object[] { "SSS", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(axeSaphir, 1), new Object[] { " SS", " 0S", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(axeSaphir, 1), new Object[] { " SS", " 0S", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(shovelSaphir, 1), new Object[] { " S ", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(shovelSaphir, 1), new Object[] { "S ", "0 ", "0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(shovelSaphir, 1), new Object[] { " S", " 0", " 0", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(hoeSaphir, 1), new Object[] { " SS", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(hoeSaphir, 1), new Object[] { "SS ", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(helmetSaphir, 1), new Object[] { "SSS", "S S", " ", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(helmetSaphir, 1), new Object[] { " ", "SSS", "S S", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(chestPlateSaphir, 1), new Object[] { "S S", "SSS", "SSS", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(leggingsSaphir, 1), new Object[] { "SSS", "S S", "S S", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(bootsSaphir, 1), new Object[] { "S S", "S S", " ", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(bootsSaphir, 1), new Object[] { " ", "S S", "S S", 'S', ModNovamine.itemSaphir }); //GameRegistry.addShapelessRecipe(new ItemStack(tutoBlock, 2), Blocks.dirt, Blocks.dirt, tutoItem); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
-
La porte n’existait pas encore
-
Utilise la balise java, sinon on peut pas voir les lignes. Il manque un espace à la ligne 244.
PS : tu n’est pas obligé de tout remplir d’espaces, si tu veux faire une épée par exemple, tu peux mettre juste une lettre dans chaque ligne.
-
package fr.minecraftforgefrance.novamine.common; import net.minecraft.block.Block; import net.minecraft.block.BlockGlowstone; import net.minecraft.block.BlockOre; 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.ItemDoor; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; 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 fr.minecraftforgefrance.novamine.proxy.CommonProxy; @Mod(modid = "modnovamine", name = "Mod Novamine", version = "1.0.0") public class ModNovamine { public static final String MODID = "modnovamine"; public static final String MODNAME = "Mod Novamine"; public static final String MODVERSION = "1.0.0"; @SidedProxy(clientSide = "fr.minecraftforgefrance.novamine.proxy.ClientProxy", serverSide = "fr.minecraftforgefrance.novamine.proxy.CommonProxy") public static CommonProxy proxy; @Instance("modnovamine") public static ModNovamine instance; public static Block porte; public static Item porteItem; public static Item itemEmerald, helmetEmerald, chestPlateEmerald, leggingsEmerald, bootsEmerald, swordEmerald, pickaxeEmerald, axeEmerald, shovelEmerald, hoeEmerald; public static Item itemNova, helmetNova, chestPlateNova, leggingsNova, bootsNova, swordNova, pickaxeNova, axeNova, shovelNova, hoeNova; public static Item itemSaphir, helmetSaphir, chestPlateSaphir, leggingsSaphir, bootsSaphir, swordSaphir, pickaxeSaphir, axeSaphir, shovelSaphir, hoeSaphir; public static Block invi, invil, Nova, LA, BlockSaphir; public static CreativeTabs Nova1_8 = new Nova1_8("Nova1_8"); public static CreativeTabs BlockNovaMine = new Nova1_8("BlockNovaMine"); public static CreativeTabs ItemNovaMine = new Nova1_8("ItemNovaMine"); public static CreativeTabs ArmurNovaMine = new Nova1_8("ArmurNovaMine"); public static ArmorMaterial armorNova = EnumHelper.addArmorMaterial("armorNova", 25, new int[] {4, 6, 5, 4}, 20); public static ArmorMaterial armorEmerald = EnumHelper.addArmorMaterial("armorEmerald", 50, new int[] {4, 9, 7, 4}, 30); public static ArmorMaterial armorSaphir = EnumHelper.addArmorMaterial("armorSaphir", 60, new int[] {5, 10, 8, 5}, 35); public static ToolMaterial toolNova = EnumHelper.addToolMaterial("toolNova", 2, 854, 12.0F, 4.0F, 18); public static ToolMaterial toolEmerald = EnumHelper.addToolMaterial("toolEmerald", 4, 2000, 10.0F, 4.0F, 18); public static ToolMaterial toolSaphir = EnumHelper.addToolMaterial("toolSaphir", 5, 2400, 10.0F, 5.0F, 19); /** Tool Armor WOOD(0, 59, 2.0F, 0.0F, 15), CLOTH(5, new int[]{1, 3, 2, 1}, 15), STONE(1, 131, 4.0F, 1.0F, 5), CHAIN(15, new int[]{2, 5, 4, 1}, 12), IRON(2, 250, 6.0F, 2.0F, 14), IRON(15, new int[]{2, 6, 5, 2}, 9), EMERALD(3, 1561, 8.0F, 3.0F, 10), GOLD(7, new int[]{2, 5, 3, 1}, 25), DIAMOND(33, new int[]{3, 8, 6, 3}, 10); */ @EventHandler public void preInit(FMLPreInitializationEvent event) { invi = new BlockInvisible(Material.rock).setBlockName("invi").setBlockTextureName(MODID + ":invi").setCreativeTab(BlockNovaMine); invil = new BlockInvisible(Material.rock).setBlockName("invil").setBlockTextureName(MODID + ":invi").setCreativeTab(BlockNovaMine).setLightLevel(1.0F); Nova = new BlockOre().setHardness(3.0F).setResistance(5.0F).setBlockName("oreIron").setBlockTextureName("iron_ore").setCreativeTab(BlockNovaMine).setStepSound(Block.soundTypeStone); LA = new BlockGlowstone(Material.glass).setHardness(0.3F).setStepSound(Block.soundTypeGlass).setLightLevel(1.0F).setBlockName("LA").setBlockTextureName(MODID + ":la").setCreativeTab(Nova1_8); helmetNova = new ItemNovaArmor(armorNova, 0).setUnlocalizedName("helmetTuto").setTextureName(MODID + ":helmet_tutoriel").setCreativeTab(ArmurNovaMine); chestPlateNova = new ItemNovaArmor(armorNova, 1).setUnlocalizedName("chestPlateTuto").setTextureName(MODID + ":chestplate_tutoriel").setCreativeTab(ArmurNovaMine); leggingsNova = new ItemNovaArmor(armorNova, 2).setUnlocalizedName("leggingsTuto").setTextureName(MODID + ":leggings_tutoriel").setCreativeTab(ArmurNovaMine); bootsNova = new ItemNovaArmor(armorNova, 3).setUnlocalizedName("bootsTuto").setTextureName(MODID + ":boots_tutoriel").setCreativeTab(ArmurNovaMine); itemNova = new ItemNova().setUnlocalizedName("tutoriel").setTextureName(MODID + ":item_tutoriel").setCreativeTab(ItemNovaMine).setCreativeTab(ItemNovaMine); swordNova = new ItemNovaSword(toolNova).setUnlocalizedName("swordTuto").setTextureName(MODID + ":sword_tutoriel").setCreativeTab(ItemNovaMine); pickaxeNova = new ItemNovaPickaxe(toolNova).setUnlocalizedName("pickaxeTuto").setTextureName(MODID + ":pickaxe_tutoriel").setCreativeTab(ItemNovaMine); axeNova = new ItemNovaAxe(toolNova).setUnlocalizedName("axeTuto").setTextureName(MODID + ":novahache").setCreativeTab(ItemNovaMine); shovelNova = new ItemNovaShovel(toolNova).setUnlocalizedName("shovelTuto").setTextureName(MODID + ":shovel_tutoriel").setCreativeTab(ItemNovaMine); hoeNova = new ItemNovaHoe(toolNova).setUnlocalizedName("hoeTuto").setTextureName(MODID + ":hoe_tutoriel").setCreativeTab(ItemNovaMine); itemEmerald = new ItemEmerald().setUnlocalizedName("tutoriel").setTextureName(MODID + ":item_tutoriel").setCreativeTab(ItemNovaMine).setCreativeTab(ItemNovaMine); helmetEmerald = new ItemEmeraldArmor(armorEmerald, 0).setUnlocalizedName("helmetEmerald").setTextureName(MODID + ":Emerald_helmet").setCreativeTab(ArmurNovaMine); chestPlateEmerald = new ItemEmeraldArmor(armorEmerald, 1).setUnlocalizedName("chestPlateEmerald").setTextureName(MODID + ":Emerald_chestplate").setCreativeTab(ArmurNovaMine); leggingsEmerald = new ItemEmeraldArmor(armorEmerald, 2).setUnlocalizedName("leggingsEmerald").setTextureName(MODID + ":Emerald_leggings").setCreativeTab(ArmurNovaMine); bootsEmerald = new ItemEmeraldArmor(armorEmerald, 3).setUnlocalizedName("bootsEmerald").setTextureName(MODID + ":Emerald_boots").setCreativeTab(ArmurNovaMine); swordEmerald = new ItemEmeraldSword(toolEmerald).setUnlocalizedName("swordEmerald").setTextureName(MODID + ":Emerald_sword").setCreativeTab(ItemNovaMine); pickaxeEmerald = new ItemEmeraldPickaxe(toolEmerald).setUnlocalizedName("pickaxeEmerald").setTextureName(MODID + ":Emerald_pickaxe").setCreativeTab(ItemNovaMine); axeEmerald = new ItemEmeraldAxe(toolEmerald).setUnlocalizedName("axeEmerald").setTextureName(MODID + ":Emerald_hatchet").setCreativeTab(ItemNovaMine); shovelEmerald = new ItemEmeraldShovel(toolEmerald).setUnlocalizedName("shovelEmerald").setTextureName(MODID + ":Emerald_shovel").setCreativeTab(ItemNovaMine); hoeEmerald = new ItemEmeraldHoe(toolEmerald).setUnlocalizedName("hoeEmerald").setTextureName(MODID + ":Emerald_hoe").setCreativeTab(ItemNovaMine); itemSaphir = new Item().setUnlocalizedName("Saphir").setCreativeTab(ItemNovaMine).setTextureName(MODID + ":Saphir"); helmetSaphir = new ItemSaphirArmor(armorSaphir, 0).setUnlocalizedName("Saphir_helmet").setTextureName(MODID + ":Saphir_helmet").setCreativeTab(ArmurNovaMine); chestPlateSaphir = new ItemSaphirArmor(armorSaphir, 1).setUnlocalizedName("Saphir_chestplate").setTextureName(MODID + ":Saphir_chestplate").setCreativeTab(ArmurNovaMine); leggingsSaphir = new ItemSaphirArmor(armorSaphir, 2).setUnlocalizedName("Saphir_leggings").setTextureName(MODID + ":Saphir_leggings").setCreativeTab(ArmurNovaMine); bootsSaphir = new ItemSaphirArmor(armorSaphir, 3).setUnlocalizedName("Saphir_boots").setTextureName(MODID + ":Saphir_boots").setCreativeTab(ArmurNovaMine); swordSaphir = new ItemSaphirSword(toolSaphir).setUnlocalizedName("Saphir_sword").setTextureName(MODID + ":Saphir_sword").setCreativeTab(ItemNovaMine); pickaxeSaphir = new ItemSaphirPickaxe(toolSaphir).setUnlocalizedName("Saphir_pickaxe").setTextureName(MODID + ":Saphir_pickaxe").setCreativeTab(ItemNovaMine); axeSaphir = new ItemSaphirAxe(toolSaphir).setUnlocalizedName("Saphir_axe").setTextureName(MODID + ":Saphir_axe").setCreativeTab(ItemNovaMine); shovelSaphir = new ItemSaphirShovel(toolSaphir).setUnlocalizedName("Saphir_shovel").setTextureName(MODID + ":Saphir_shovel").setCreativeTab(ItemNovaMine); hoeSaphir = new ItemSaphirHoe(toolSaphir).setUnlocalizedName("Saphir_hoe").setTextureName(MODID + ":Saphir_hoe").setCreativeTab(ItemNovaMine); BlockSaphir = new BlockSaphir (Material.rock).setBlockName("BlockSaphir").setBlockTextureName(MODID + ":Saphir_block").setCreativeTab(BlockNovaMine); porte = new Porte().setBlockName("porte").setBlockTextureName("spruce_upper").setBlockTextureName("spruce_lower"); porteItem = new ItemPorte().setUnlocalizedName("PorteS").setTextureName("spruce"); } @EventHandler public void init(FMLInitializationEvent event) { GameRegistry.registerBlock(porte, "porte"); GameRegistry.registerItem(porteItem, "item_porte"); GameRegistry.registerBlock(invi, "invi"); GameRegistry.registerBlock(invil, "invil"); GameRegistry.registerBlock(Nova, "Nova"); GameRegistry.registerBlock(LA, "LA"); GameRegistry.registerItem(itemNova, "itemNova"); GameRegistry.registerItem(helmetNova, "item_tuto_helmet"); GameRegistry.registerItem(chestPlateNova, "item_tuto_chestplate"); GameRegistry.registerItem(leggingsNova, "item_tuto_leggings"); GameRegistry.registerItem(bootsNova, "item_tuto_boots"); GameRegistry.registerItem(swordNova, "item_tuto_sword"); GameRegistry.registerItem(pickaxeNova, "item_tuto_pickaxe"); GameRegistry.registerItem(axeNova, "item_tuto_axe"); GameRegistry.registerItem(shovelNova, "item_tuto_shovel"); GameRegistry.registerItem(hoeNova, "item_tuto_hoe"); GameRegistry.registerItem(itemEmerald, "itemEmerald"); GameRegistry.registerItem(helmetEmerald, "helmetEmerald"); GameRegistry.registerItem(chestPlateEmerald, "chestPlateEmerald"); GameRegistry.registerItem(leggingsEmerald, "leggingsEmerald"); GameRegistry.registerItem(bootsEmerald, "bootsEmerald"); GameRegistry.registerItem(swordEmerald, "swordEmerald"); GameRegistry.registerItem(pickaxeEmerald, "pickaxeEmerald"); GameRegistry.registerItem(axeEmerald, "axeEmerald"); GameRegistry.registerItem(shovelEmerald, "shovelEmerald"); GameRegistry.registerItem(hoeEmerald, "hoeEmerald"); GameRegistry.registerItem(itemSaphir, "itemSaphir"); GameRegistry.registerItem(helmetSaphir, "helmetSaphir"); GameRegistry.registerItem(chestPlateSaphir, "chestPlateSaphir"); GameRegistry.registerItem(leggingsSaphir, "leggingsSaphir"); GameRegistry.registerItem(bootsSaphir, "bootsSaphir"); GameRegistry.registerItem(swordSaphir, "swordSaphir"); GameRegistry.registerItem(pickaxeSaphir, "pickaxeSaphir"); GameRegistry.registerItem(axeSaphir, "axeSaphir"); GameRegistry.registerItem(shovelSaphir, "shovelSaphir"); GameRegistry.registerItem(hoeSaphir, "hoeSaphir"); GameRegistry.registerBlock(BlockSaphir, "BlockSaphir"); //recette GameRegistry.addRecipe(new ItemStack(swordEmerald, 1), new Object[] { " E ", " E ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(swordEmerald, 1), new Object[] { "E ", "E ", "S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(swordEmerald, 1), new Object[] { " E", " E", " S", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(pickaxeEmerald, 1), new Object[] { "EEE", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(axeEmerald, 1), new Object[] { " EE", " SE", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(axeEmerald, 1), new Object[] { "EE ", "ES ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(shovelEmerald, 1), new Object[] { " E ", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(shovelEmerald, 1), new Object[] { "E ", "S ", "S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(shovelEmerald, 1), new Object[] { " E", " S", " S", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(hoeEmerald, 1), new Object[] { "EE ", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(hoeEmerald, 1), new Object[] { " EE", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(helmetEmerald, 1), new Object[] { "EEE", "E E", " ", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(helmetEmerald, 1), new Object[] { " ", "EEE", "E E", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(chestPlateEmerald, 1), new Object[] { "E E", "EEE", "EEE", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(leggingsEmerald, 1), new Object[] { "EEE", "E E", "E E", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(bootsEmerald, 1), new Object[] { " ", "E E", "E E", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(bootsEmerald, 1), new Object[] { "E E", "E E", " ", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(BlockSaphir, 1), new Object[] { "SSS", "SSS", "SSS", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { " S ", " S ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { "S ", "S ", "0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { " S", " S", " 0", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(pickaxeSaphir, 1), new Object[] { "SSS", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(axeSaphir, 1), new Object[] { " SS", " 0S", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(axeSaphir, 1), new Object[] { " SS", " 0S", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(shovelSaphir, 1), new Object[] { " S ", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(shovelSaphir, 1), new Object[] { "S ", "0 ", "0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(shovelSaphir, 1), new Object[] { " S", " 0", " 0", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(hoeSaphir, 1), new Object[] { " SS", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(hoeSaphir, 1), new Object[] { "SS ", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(helmetSaphir, 1), new Object[] { "SSS", "S S", " ", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(helmetSaphir, 1), new Object[] { " ", "SSS", "S S", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(chestPlateSaphir, 1), new Object[] { "S S", "SSS", "SSS", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(leggingsSaphir, 1), new Object[] { "SSS", "S S", "S S", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(bootsSaphir, 1), new Object[] { "S S", "S S", " ", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(bootsSaphir, 1), new Object[] { " ", "S S", "S S", 'S', ModNovamine.itemSaphir }); //GameRegistry.addShapelessRecipe(new ItemStack(tutoBlock, 2), Blocks.dirt, Blocks.dirt, tutoItem); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
-
Tu n’as pas suivis ce que j’ai dit : il te manque un espace ligne 244.
-
Et pour la porte les texture pour l’items c’est .setUnlocalizedName(“texture”)
Mais pour la porte c pas .setBlockTextureName(“texture_upper”, “textures_lower”) -
Je ne pense pas car c’est un model spécial, regarde dans les classes de minecraft comment c’est fait.
-
@‘Diangle’:
@‘TheAzkaze’:
Dans c’est codage je ne vois pas ou est la nouvelle textures de la porte
C’est le principe de l’héritage, le code de la texture est dans la classe mère. Tu as juste à mettre dans initialisation du bloc “setBlockTextureName(“texture”)”, donc la texture devrons avoir pour nom : “texture_lower.png” et “texture_upper.png”. Attention, il faut aussi mettre un texture à l’item.
Diangle marque sa mais sa ne marche pas
-
porte = new Porte().setBlockName(“porte”).setBlockTextureName(“spruce”);
Juste comme ça. Le code de la porte ajoute déjà le _upper et _lowerEt comme SCAREX l’a dit, ligne 242 - 246 ça devrait être :
GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { "S ", "S ", "0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir });
ou :
GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { "S", "S", "0", '0', Items.stick, 'S', ModNovamine.itemSaphir });
Et non :
GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { "S ", "S ", "0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir });
-
Oui mais dans ses code il ne la pas
-
il ne la pas quoi ? le _lower et _upper ? Ils sont dans la classe mère (déjà dit)… Si tu comprends pas ça, apprend un peu le java.
-
Je ne les vois pas
-
Et la porte a chaque fois que je l’ouvre même si il n’y a pas les textures elle tp et te kill car elle creuse jusqya la bedrock
-
gné ? ça devrais pas… tu as touché au code ?
-
non
J’ai juste copier coler -
tu peux m’envoyer le code ?
-
Ma class principal
package fr.minecraftforgefrance.novamine.common; import net.minecraft.block.Block; import net.minecraft.block.BlockGlowstone; import net.minecraft.block.BlockOre; 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.ItemDoor; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.EnumHelper; 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 fr.minecraftforgefrance.novamine.proxy.CommonProxy; @Mod(modid = "modnovamine", name = "Mod Novamine", version = "1.0.0") public class ModNovamine { public static final String MODID = "modnovamine"; public static final String MODNAME = "Mod Novamine"; public static final String MODVERSION = "1.0.0"; @SidedProxy(clientSide = "fr.minecraftforgefrance.novamine.proxy.ClientProxy", serverSide = "fr.minecraftforgefrance.novamine.proxy.CommonProxy") public static CommonProxy proxy; @Instance("modnovamine") public static ModNovamine instance; public static Block porte; public static Item porteItem; public static Item itemEmerald, helmetEmerald, chestPlateEmerald, leggingsEmerald, bootsEmerald, swordEmerald, pickaxeEmerald, axeEmerald, shovelEmerald, hoeEmerald; public static Item itemNova, helmetNova, chestPlateNova, leggingsNova, bootsNova, swordNova, pickaxeNova, axeNova, shovelNova, hoeNova; public static Item itemSaphir, helmetSaphir, chestPlateSaphir, leggingsSaphir, bootsSaphir, swordSaphir, pickaxeSaphir, axeSaphir, shovelSaphir, hoeSaphir; public static Block invi, invil, Nova, LA, BlockSaphir; public static CreativeTabs Nova1_8 = new Nova1_8("Nova1_8"); public static CreativeTabs BlockNovaMine = new Nova1_8("BlockNovaMine"); public static CreativeTabs ItemNovaMine = new Nova1_8("ItemNovaMine"); public static CreativeTabs ArmurNovaMine = new Nova1_8("ArmurNovaMine"); public static ArmorMaterial armorNova = EnumHelper.addArmorMaterial("armorNova", 25, new int[] {4, 6, 5, 4}, 20); public static ArmorMaterial armorEmerald = EnumHelper.addArmorMaterial("armorEmerald", 50, new int[] {4, 9, 7, 4}, 30); public static ArmorMaterial armorSaphir = EnumHelper.addArmorMaterial("armorSaphir", 60, new int[] {5, 10, 8, 5}, 35); public static ToolMaterial toolNova = EnumHelper.addToolMaterial("toolNova", 2, 854, 12.0F, 4.0F, 18); public static ToolMaterial toolEmerald = EnumHelper.addToolMaterial("toolEmerald", 4, 2000, 10.0F, 4.0F, 18); public static ToolMaterial toolSaphir = EnumHelper.addToolMaterial("toolSaphir", 5, 2400, 10.0F, 5.0F, 19); /** Tool Armor WOOD(0, 59, 2.0F, 0.0F, 15), CLOTH(5, new int[]{1, 3, 2, 1}, 15), STONE(1, 131, 4.0F, 1.0F, 5), CHAIN(15, new int[]{2, 5, 4, 1}, 12), IRON(2, 250, 6.0F, 2.0F, 14), IRON(15, new int[]{2, 6, 5, 2}, 9), EMERALD(3, 1561, 8.0F, 3.0F, 10), GOLD(7, new int[]{2, 5, 3, 1}, 25), DIAMOND(33, new int[]{3, 8, 6, 3}, 10); */ @EventHandler public void preInit(FMLPreInitializationEvent event) { invi = new BlockInvisible(Material.rock).setBlockName("invi").setBlockTextureName(MODID + ":invi").setCreativeTab(BlockNovaMine); invil = new BlockInvisible(Material.rock).setBlockName("invil").setBlockTextureName(MODID + ":invi").setCreativeTab(BlockNovaMine).setLightLevel(1.0F); Nova = new BlockOre().setHardness(3.0F).setResistance(5.0F).setBlockName("oreIron").setBlockTextureName("iron_ore").setCreativeTab(BlockNovaMine).setStepSound(Block.soundTypeStone); LA = new BlockGlowstone(Material.glass).setHardness(0.3F).setStepSound(Block.soundTypeGlass).setLightLevel(1.0F).setBlockName("LA").setBlockTextureName(MODID + ":la").setCreativeTab(Nova1_8); helmetNova = new ItemNovaArmor(armorNova, 0).setUnlocalizedName("helmetTuto").setTextureName(MODID + ":helmet_tutoriel").setCreativeTab(ArmurNovaMine); chestPlateNova = new ItemNovaArmor(armorNova, 1).setUnlocalizedName("chestPlateTuto").setTextureName(MODID + ":chestplate_tutoriel").setCreativeTab(ArmurNovaMine); leggingsNova = new ItemNovaArmor(armorNova, 2).setUnlocalizedName("leggingsTuto").setTextureName(MODID + ":leggings_tutoriel").setCreativeTab(ArmurNovaMine); bootsNova = new ItemNovaArmor(armorNova, 3).setUnlocalizedName("bootsTuto").setTextureName(MODID + ":boots_tutoriel").setCreativeTab(ArmurNovaMine); itemNova = new ItemNova().setUnlocalizedName("tutoriel").setTextureName(MODID + ":item_tutoriel").setCreativeTab(ItemNovaMine).setCreativeTab(ItemNovaMine); swordNova = new ItemNovaSword(toolNova).setUnlocalizedName("swordTuto").setTextureName(MODID + ":sword_tutoriel").setCreativeTab(ItemNovaMine); pickaxeNova = new ItemNovaPickaxe(toolNova).setUnlocalizedName("pickaxeTuto").setTextureName(MODID + ":pickaxe_tutoriel").setCreativeTab(ItemNovaMine); axeNova = new ItemNovaAxe(toolNova).setUnlocalizedName("axeTuto").setTextureName(MODID + ":novahache").setCreativeTab(ItemNovaMine); shovelNova = new ItemNovaShovel(toolNova).setUnlocalizedName("shovelTuto").setTextureName(MODID + ":shovel_tutoriel").setCreativeTab(ItemNovaMine); hoeNova = new ItemNovaHoe(toolNova).setUnlocalizedName("hoeTuto").setTextureName(MODID + ":hoe_tutoriel").setCreativeTab(ItemNovaMine); itemEmerald = new ItemEmerald().setUnlocalizedName("tutoriel").setTextureName(MODID + ":item_tutoriel").setCreativeTab(ItemNovaMine).setCreativeTab(ItemNovaMine); helmetEmerald = new ItemEmeraldArmor(armorEmerald, 0).setUnlocalizedName("helmetEmerald").setTextureName(MODID + ":Emerald_helmet").setCreativeTab(ArmurNovaMine); chestPlateEmerald = new ItemEmeraldArmor(armorEmerald, 1).setUnlocalizedName("chestPlateEmerald").setTextureName(MODID + ":Emerald_chestplate").setCreativeTab(ArmurNovaMine); leggingsEmerald = new ItemEmeraldArmor(armorEmerald, 2).setUnlocalizedName("leggingsEmerald").setTextureName(MODID + ":Emerald_leggings").setCreativeTab(ArmurNovaMine); bootsEmerald = new ItemEmeraldArmor(armorEmerald, 3).setUnlocalizedName("bootsEmerald").setTextureName(MODID + ":Emerald_boots").setCreativeTab(ArmurNovaMine); swordEmerald = new ItemEmeraldSword(toolEmerald).setUnlocalizedName("swordEmerald").setTextureName(MODID + ":Emerald_sword").setCreativeTab(ItemNovaMine); pickaxeEmerald = new ItemEmeraldPickaxe(toolEmerald).setUnlocalizedName("pickaxeEmerald").setTextureName(MODID + ":Emerald_pickaxe").setCreativeTab(ItemNovaMine); axeEmerald = new ItemEmeraldAxe(toolEmerald).setUnlocalizedName("axeEmerald").setTextureName(MODID + ":Emerald_hatchet").setCreativeTab(ItemNovaMine); shovelEmerald = new ItemEmeraldShovel(toolEmerald).setUnlocalizedName("shovelEmerald").setTextureName(MODID + ":Emerald_shovel").setCreativeTab(ItemNovaMine); hoeEmerald = new ItemEmeraldHoe(toolEmerald).setUnlocalizedName("hoeEmerald").setTextureName(MODID + ":Emerald_hoe").setCreativeTab(ItemNovaMine); itemSaphir = new Item().setUnlocalizedName("Saphir").setCreativeTab(ItemNovaMine).setTextureName(MODID + ":Saphir"); helmetSaphir = new ItemSaphirArmor(armorSaphir, 0).setUnlocalizedName("Saphir_helmet").setTextureName(MODID + ":Saphir_helmet").setCreativeTab(ArmurNovaMine); chestPlateSaphir = new ItemSaphirArmor(armorSaphir, 1).setUnlocalizedName("Saphir_chestplate").setTextureName(MODID + ":Saphir_chestplate").setCreativeTab(ArmurNovaMine); leggingsSaphir = new ItemSaphirArmor(armorSaphir, 2).setUnlocalizedName("Saphir_leggings").setTextureName(MODID + ":Saphir_leggings").setCreativeTab(ArmurNovaMine); bootsSaphir = new ItemSaphirArmor(armorSaphir, 3).setUnlocalizedName("Saphir_boots").setTextureName(MODID + ":Saphir_boots").setCreativeTab(ArmurNovaMine); swordSaphir = new ItemSaphirSword(toolSaphir).setUnlocalizedName("Saphir_sword").setTextureName(MODID + ":Saphir_sword").setCreativeTab(ItemNovaMine); pickaxeSaphir = new ItemSaphirPickaxe(toolSaphir).setUnlocalizedName("Saphir_pickaxe").setTextureName(MODID + ":Saphir_pickaxe").setCreativeTab(ItemNovaMine); axeSaphir = new ItemSaphirAxe(toolSaphir).setUnlocalizedName("Saphir_axe").setTextureName(MODID + ":Saphir_axe").setCreativeTab(ItemNovaMine); shovelSaphir = new ItemSaphirShovel(toolSaphir).setUnlocalizedName("Saphir_shovel").setTextureName(MODID + ":Saphir_shovel").setCreativeTab(ItemNovaMine); hoeSaphir = new ItemSaphirHoe(toolSaphir).setUnlocalizedName("Saphir_hoe").setTextureName(MODID + ":Saphir_hoe").setCreativeTab(ItemNovaMine); BlockSaphir = new BlockSaphir (Material.rock).setBlockName("BlockSaphir").setBlockTextureName(MODID + ":Saphir_block").setCreativeTab(BlockNovaMine); porte = new Porte().setBlockName("porte").setBlockTextureName("spruce"); porteItem = new ItemPorte().setTextureName("spruce"); } @EventHandler public void init(FMLInitializationEvent event) { GameRegistry.registerBlock(porte, "porte"); GameRegistry.registerItem(porteItem, "item_porte"); GameRegistry.registerBlock(invi, "invi"); GameRegistry.registerBlock(invil, "invil"); GameRegistry.registerBlock(Nova, "Nova"); GameRegistry.registerBlock(LA, "LA"); GameRegistry.registerItem(itemNova, "itemNova"); GameRegistry.registerItem(helmetNova, "item_tuto_helmet"); GameRegistry.registerItem(chestPlateNova, "item_tuto_chestplate"); GameRegistry.registerItem(leggingsNova, "item_tuto_leggings"); GameRegistry.registerItem(bootsNova, "item_tuto_boots"); GameRegistry.registerItem(swordNova, "item_tuto_sword"); GameRegistry.registerItem(pickaxeNova, "item_tuto_pickaxe"); GameRegistry.registerItem(axeNova, "item_tuto_axe"); GameRegistry.registerItem(shovelNova, "item_tuto_shovel"); GameRegistry.registerItem(hoeNova, "item_tuto_hoe"); GameRegistry.registerItem(itemEmerald, "itemEmerald"); GameRegistry.registerItem(helmetEmerald, "helmetEmerald"); GameRegistry.registerItem(chestPlateEmerald, "chestPlateEmerald"); GameRegistry.registerItem(leggingsEmerald, "leggingsEmerald"); GameRegistry.registerItem(bootsEmerald, "bootsEmerald"); GameRegistry.registerItem(swordEmerald, "swordEmerald"); GameRegistry.registerItem(pickaxeEmerald, "pickaxeEmerald"); GameRegistry.registerItem(axeEmerald, "axeEmerald"); GameRegistry.registerItem(shovelEmerald, "shovelEmerald"); GameRegistry.registerItem(hoeEmerald, "hoeEmerald"); GameRegistry.registerItem(itemSaphir, "itemSaphir"); GameRegistry.registerItem(helmetSaphir, "helmetSaphir"); GameRegistry.registerItem(chestPlateSaphir, "chestPlateSaphir"); GameRegistry.registerItem(leggingsSaphir, "leggingsSaphir"); GameRegistry.registerItem(bootsSaphir, "bootsSaphir"); GameRegistry.registerItem(swordSaphir, "swordSaphir"); GameRegistry.registerItem(pickaxeSaphir, "pickaxeSaphir"); GameRegistry.registerItem(axeSaphir, "axeSaphir"); GameRegistry.registerItem(shovelSaphir, "shovelSaphir"); GameRegistry.registerItem(hoeSaphir, "hoeSaphir"); GameRegistry.registerBlock(BlockSaphir, "BlockSaphir"); //recette GameRegistry.addRecipe(new ItemStack(swordEmerald, 1), new Object[] { " E ", " E ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(swordEmerald, 1), new Object[] { "E ", "E ", "S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(swordEmerald, 1), new Object[] { " E", " E", " S", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(pickaxeEmerald, 1), new Object[] { "EEE", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(axeEmerald, 1), new Object[] { " EE", " SE", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(axeEmerald, 1), new Object[] { "EE ", "ES ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(shovelEmerald, 1), new Object[] { " E ", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(shovelEmerald, 1), new Object[] { "E ", "S ", "S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(shovelEmerald, 1), new Object[] { " E", " S", " S", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(hoeEmerald, 1), new Object[] { "EE ", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(hoeEmerald, 1), new Object[] { " EE", " S ", " S ", 'S', Items.stick, 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(helmetEmerald, 1), new Object[] { "EEE", "E E", " ", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(helmetEmerald, 1), new Object[] { " ", "EEE", "E E", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(chestPlateEmerald, 1), new Object[] { "E E", "EEE", "EEE", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(leggingsEmerald, 1), new Object[] { "EEE", "E E", "E E", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(bootsEmerald, 1), new Object[] { " ", "E E", "E E", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(bootsEmerald, 1), new Object[] { "E E", "E E", " ", 'E', Items.emerald }); GameRegistry.addRecipe(new ItemStack(BlockSaphir, 1), new Object[] { "SSS", "SSS", "SSS", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { " S ", " S ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { "S ", "S ", "0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(swordSaphir, 1), new Object[] { " S", " S", " 0", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(pickaxeSaphir, 1), new Object[] { "SSS", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(axeSaphir, 1), new Object[] { " SS", " 0S", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(axeSaphir, 1), new Object[] { " SS", " 0S", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(shovelSaphir, 1), new Object[] { " S ", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(shovelSaphir, 1), new Object[] { "S ", "0 ", "0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(shovelSaphir, 1), new Object[] { " S", " 0", " 0", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(hoeSaphir, 1), new Object[] { " SS", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(hoeSaphir, 1), new Object[] { "SS ", " 0 ", " 0 ", '0', Items.stick, 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(helmetSaphir, 1), new Object[] { "SSS", "S S", " ", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(helmetSaphir, 1), new Object[] { " ", "SSS", "S S", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(chestPlateSaphir, 1), new Object[] { "S S", "SSS", "SSS", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(leggingsSaphir, 1), new Object[] { "SSS", "S S", "S S", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(bootsSaphir, 1), new Object[] { "S S", "S S", " ", 'S', ModNovamine.itemSaphir }); GameRegistry.addRecipe(new ItemStack(bootsSaphir, 1), new Object[] { " ", "S S", "S S", 'S', ModNovamine.itemSaphir }); //GameRegistry.addShapelessRecipe(new ItemStack(tutoBlock, 2), Blocks.dirt, Blocks.dirt, tutoItem); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } }
La class porte
package fr.minecraftforgefrance.novamine.common; import java.util.Random; import net.minecraft.block.BlockDoor; import net.minecraft.block.material.Material; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class Porte extends BlockDoor { public Porte() { super(Material.anvil); this.setHardness(3.0F); this.setResistance(5.0F); this.disableStats(); } @Override public Item getItemDropped(int par1, Random rand, int par3) { return ModNovamine.porteItem; } @Override @SideOnly(Side.CLIENT) public Item getItem(World world, int x, int y, int z) { return ModNovamine.porteItem; } @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { int pX = (int)player.posX; int pY = (int)player.posY; int pZ = (int)player.posZ; player.setPositionAndUpdate(pX + 0.5, pY, pZ + 0.5); if(player.capabilities.isFlying) player.capabilities.isFlying = false; player.setSpawnChunk(new ChunkCoordinates(pX, -120, pZ), true); for(int y1 = pY; y1 >= 0; y1–) world.setBlock(pX, y1, pZ, Blocks.air); return true; } @Override @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) { this.setBlockBoundsBasedOnState(world, x, y, z); return super.getSelectedBoundingBoxFromPool(world, x, y, z); } @Override public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) { this.setBlockBoundsBasedOnState(world, x, y, z); return super.getCollisionBoundingBoxFromPool(world, x, y, z); } @Override public void setBlockBoundsBasedOnState(IBlockAccess blockaccess, int x, int y, int z) { this.func_150011_b(this.func_150012_g(blockaccess, x, y, z)); } @Override public int func_150013_e(IBlockAccess blockaccess, int x, int y, int z) { return this.func_150012_g(blockaccess, x, y, z) & 3; } @Override public boolean func_150015_f(IBlockAccess blockaccess, int x, int y, int z) { return (this.func_150012_g(blockaccess, x, y, z) & 4) != 0; } private void func_150011_b(int par1) { float f = 0.1875F; this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F); int j = par1 & 3; boolean flag = (par1 & 4) != 0; boolean flag1 = (par1 & 16) != 0; if(j == 0) { if(flag) { if(!flag1) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); } else { this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); } } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); } } else if(j == 1) { if(flag) { if(!flag1) { this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); } } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); } } else if(j == 2) { if(flag) { if(!flag1) { this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); } else { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); } } else { this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } } else if(j == 3) { if(flag) { if(!flag1) { this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); } else { this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } } else { this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); } } } }
La class porte item
package fr.minecraftforgefrance.novamine.common; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class ItemPorte extends Item { public ItemPorte() { this.maxStackSize = 1; this.setCreativeTab(CreativeTabs.tabBlock); } public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) { if(side != 1) { return false; } else { ++y; Block block = ModNovamine.porte; if(player.canPlayerEdit(x, y, z, side, itemStack) && player.canPlayerEdit(x, y + 1, z, side, itemStack)) { if(!block.canPlaceBlockAt(world, x, y, z)) { return false; } else { int i1 = MathHelper.floor_double((double)((player.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; placeDoorBlock(world, x, y, z, i1, block); --itemStack.stackSize; return true; } } else { return false; } } } public static void placeDoorBlock(World world, int x, int y, int z, int side, Block block) { byte b0 = 0; byte b1 = 0; if(side == 0) { b1 = 1; } if(side == 1) { b0 = -1; } if(side == 2) { b1 = -1; } if(side == 3) { b0 = 1; } int i1 = (world.getBlock(x - b0, y, z - b1).isNormalCube() ? 1 : 0) + (world.getBlock(x - b0, y + 1, z - b1).isNormalCube() ? 1 : 0); int j1 = (world.getBlock(x + b0, y, z + b1).isNormalCube() ? 1 : 0) + (world.getBlock(x + b0, y + 1, z + b1).isNormalCube() ? 1 : 0); boolean flag = world.getBlock(x - b0, y, z - b1) == block || world.getBlock(x - b0, y + 1, z - b1) == block; boolean flag1 = world.getBlock(x + b0, y, z + b1) == block || world.getBlock(x + b0, y + 1, z + b1) == block; boolean flag2 = false; if(flag && !flag1) { flag2 = true; } else if(j1 > i1) { flag2 = true; } world.setBlock(x, y, z, block, side, 2); world.setBlock(x, y + 1, z, block, 8 | (flag2 ? 1 : 0), 2); world.notifyBlocksOfNeighborChange(x, y, z, block); world.notifyBlocksOfNeighborChange(x, y + 1, z, block); } }
-
Explique moi pourquoi tu téléporte le joueur ?
player.setPositionAndUpdate(pX + 0.5, pY, pZ + 0.5);
-
J’ai juste copier coller le code de Diangle