Résolu Petit réglage pour biome
-
bonjour je veux créer un biome et non un world type et l’enregistre dans la classe principale
j’ai déja vu le tuto de la 1.6 et j’ai réglé quelques fixe pour le mettre en 1.7voila ce qui est fait merci de verifie le code svp car il ya eu beaucoup de changement depuis la 1.6 alors certaines fonctions ont changer comme par exemple :
GameRegistry.addBiome(tutorialBiome);
this.topBlock = (byte)Block.blockRedstone.blockID; // byte ne marche plus donc j'ai mis block a la place
.setMinMaxHeight(0.3F, 0.5F); //n'existe plus donc je fait comment moi
tuto 1.6.4 http://www.minecraftforgefrance.fr/showthread.php?tid=280
:::
package fr.monpetitflocon.fantasymod.common; import java.awt.Color; import cpw.mods.fml.common.FMLCommonHandler; 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.EntityRegistry; import cpw.mods.fml.common.registry.GameRegistry; import fr.monpetitflocon.fantasymod.common.blocks.fantasyOre; import fr.monpetitflocon.fantasymod.common.entity.Aznching; import fr.monpetitflocon.fantasymod.common.entity.Darkheaven; import fr.monpetitflocon.fantasymod.common.entity.FuriousJumper; import fr.monpetitflocon.fantasymod.common.entity.Oxilac; import fr.monpetitflocon.fantasymod.common.items.FufuAple; import fr.monpetitflocon.fantasymod.common.items.HautEpee; import fr.monpetitflocon.fantasymod.common.items.ItemFantasyArmor; import fr.monpetitflocon.fantasymod.common.items.ItemFantasyAxe; import fr.monpetitflocon.fantasymod.common.items.ItemFantasyHoe; import fr.monpetitflocon.fantasymod.common.items.ItemFantasyPickaxe; import fr.monpetitflocon.fantasymod.common.items.ItemFantasyShovel; import fr.monpetitflocon.fantasymod.common.items.ItemFantasySword; import fr.monpetitflocon.fantasymod.common.items.MancheEpee; import fr.monpetitflocon.fantasymod.common.items.MilieuEpee; import fr.monpetitflocon.fantasymod.common.items.fantasyIngot; import fr.monpetitflocon.fantasymod.proxy.CommonProxy; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EnumCreatureType; 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.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.BiomeManager; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.EnumHelper; @Mod(modid = "fantasymod", name = "Fantasy Mod", version = "2.0.0") public class FantasyMod { public static final String MODID = "fantasymod"; @Instance("fantasymod") public static FantasyMod instance; @SidedProxy(clientSide = "fr.monpetitflocon.fantasymod.proxy.ClientProxy", serverSide = "fr.monpetitflocon.fantasymod.proxy.CommonProxy") public static CommonProxy proxy; public static Item fantasyIngot, fufuaple, helmetFantasy, chestPlateFantasy, leggingsFantasy, bootsFantasy, swordFantasy, pickaxeFantasy, axeFantasy, shovelFantasy, hoeFantasy, MancheEpee, MilieuEpee, HautEpee; public static Item Waterstack, Lavastack, Milkstack; public static Block blockOre; public static BiomeGenBase fantasyBiome; public static ArmorMaterial armorFantasy = EnumHelper.addArmorMaterial("armorFantasy", 45, new int[] {4, 9, 7, 4}, 30); public static ToolMaterial toolFantasy = EnumHelper.addToolMaterial("toolFantasy", 3, 1000, 12.0F, 4.0F, 20); public static ToolMaterial toolsword = EnumHelper.addToolMaterial("toolFantasy", 3, 1000, 12.0F, 14.0F, 20); public static CreativeTabs FantasyItemCreativeTabs = new FantasyItemCreativeTabs("fantasy_item_creative_tabs"); WorldGeneration worldgeneration = new WorldGeneration(); @EventHandler public void preInit(FMLPreInitializationEvent event) { fantasyIngot = new fantasyIngot().setUnlocalizedName("fantasyIngot").setTextureName(MODID + ":Item_fantasyIngot"); fufuaple = new FufuAple(5, 1.5F, false).setAlwaysEdible().setUnlocalizedName("fufuaple").setTextureName(MODID + ":Item_fufuaple"); helmetFantasy = new ItemFantasyArmor(armorFantasy, 0).setUnlocalizedName("helmetFantasy").setTextureName(MODID + ":helmet_fantasy"); chestPlateFantasy = new ItemFantasyArmor(armorFantasy, 1).setUnlocalizedName("chestPlateFantasy").setTextureName(MODID + ":chestplate_fantasy"); leggingsFantasy = new ItemFantasyArmor(armorFantasy, 2).setUnlocalizedName("leggingsFantasy").setTextureName(MODID + ":leggings_fantasy"); bootsFantasy = new ItemFantasyArmor(armorFantasy, 3).setUnlocalizedName("bootsFantasy").setTextureName(MODID + ":boots_fantasy"); swordFantasy = new ItemFantasySword(toolsword).setUnlocalizedName("swordFantasy").setTextureName(MODID + ":sword_fantasy"); pickaxeFantasy = new ItemFantasyPickaxe(toolFantasy).setUnlocalizedName("pickaxeFantasy").setTextureName(MODID + ":pickaxe_fantasy"); axeFantasy = new ItemFantasyAxe(toolFantasy).setUnlocalizedName("axeFantasy").setTextureName(MODID + ":axe_fantasy"); shovelFantasy = new ItemFantasyShovel(toolFantasy).setUnlocalizedName("shovelFantasy").setTextureName(MODID + ":shovel_fantasy"); hoeFantasy = new ItemFantasyHoe(toolFantasy).setUnlocalizedName("hoeFantasy").setTextureName(MODID + ":hoe_fantasy"); MancheEpee = new MancheEpee().setUnlocalizedName("MancheEpee").setTextureName(MODID + ":manche_epee"); MilieuEpee = new MilieuEpee().setUnlocalizedName("MilieuEpee").setTextureName(MODID + ":milieu_epee"); HautEpee = new HautEpee().setUnlocalizedName("HautEpee").setTextureName(MODID + ":haut_epee"); Waterstack = new HautEpee().setUnlocalizedName("Waterstack").setTextureName(MODID + ":water_stack"); Lavastack = new HautEpee().setUnlocalizedName("Lavastack").setTextureName(MODID + ":lava_stack"); Milkstack = new HautEpee().setUnlocalizedName("Milkstack").setTextureName(MODID + ":milk_stack"); blockOre = new fantasyOre(Material.rock).setHardness(15.0F).setResistance(10.0F).setBlockName("FantasyOre").setBlockTextureName(MODID + ":fantasy_ore"); GameRegistry.registerItem(fantasyIngot, "Item_fantasyIngot"); GameRegistry.registerItem(fufuaple, "item_fufuaple"); GameRegistry.registerItem(helmetFantasy, "item_fantasy_helmet"); GameRegistry.registerItem(chestPlateFantasy, "item_fantasy_chestplate"); GameRegistry.registerItem(leggingsFantasy, "item_fantasy_leggings"); GameRegistry.registerItem(bootsFantasy, "item_fantasy_boots"); GameRegistry.registerItem(swordFantasy, "item_fantasy_sword"); GameRegistry.registerItem(pickaxeFantasy, "item_fantasy_pickaxe"); GameRegistry.registerItem(axeFantasy, "item_fantasy_axe"); GameRegistry.registerItem(shovelFantasy, "item_fantasy_shovel"); GameRegistry.registerItem(hoeFantasy, "item_fantasy_hoe"); GameRegistry.registerItem(MancheEpee, "manche_epee"); GameRegistry.registerItem(MilieuEpee, "milieu_epee"); GameRegistry.registerItem(HautEpee, "haut_epee"); GameRegistry.registerItem(Waterstack, "water_stack"); GameRegistry.registerItem(Lavastack, "lava_stack"); GameRegistry.registerItem(Milkstack, "milk_stack"); GameRegistry.registerBlock(blockOre, "fantasy_ore"); GameRegistry.registerWorldGenerator(worldgeneration, 0); } public static BiomeGenBase[] allBiomes = {BiomeGenBase.plains, BiomeGenBase.extremeHills, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.desertHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.river, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.coldBeach, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.deepOcean, BiomeGenBase.extremeHillsPlus, BiomeGenBase.jungleEdge, BiomeGenBase.megaTaiga, BiomeGenBase.megaTaigaHills, BiomeGenBase.mesa, BiomeGenBase.mesaPlateau, BiomeGenBase.mesaPlateau_F, BiomeGenBase.roofedForest, BiomeGenBase.savanna, BiomeGenBase.savannaPlateau, BiomeGenBase.stoneBeach}; @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new LivingEventHandler()); FMLCommonHandler.instance().bus().register(new PlayerEventHandler()); MinecraftForge.EVENT_BUS.register(new PlayerEventHandler()); EntityRegistry.registerGlobalEntityID(FuriousJumper.class, "FuriousJumper", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(FuriousJumper.class, "FuriousJumper", 430, FantasyMod.instance, 140, 87, true); EntityRegistry.addSpawn(FuriousJumper.class, 9, 1, 3, EnumCreatureType.monster, allBiomes); EntityRegistry.registerGlobalEntityID(Aznching.class, "Aznching", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(Aznching.class, "Aznching", 431, FantasyMod.instance, 40, 1, true); EntityRegistry.addSpawn(Aznching.class, 9, 1, 3, EnumCreatureType.monster, allBiomes); EntityRegistry.registerGlobalEntityID(Oxilac.class, "Oxilac", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(Oxilac.class, "Oxilac", 432, FantasyMod.instance, 40, 1, true); EntityRegistry.addSpawn(Oxilac.class, 9, 1, 3, EnumCreatureType.monster, allBiomes); EntityRegistry.registerGlobalEntityID(Darkheaven.class, "Darkheaven", EntityRegistry.findGlobalUniqueEntityId(), new Color(97, 0, 255).getRGB(), new Color(146, 91, 255).getRGB()); EntityRegistry.registerModEntity(Darkheaven.class, "Darkheaven", 433, FantasyMod.instance, 40, 1, true); EntityRegistry.addSpawn(Darkheaven.class, 9, 1, 3, EnumCreatureType.monster, allBiomes); proxy.registerRender(); ItemStack itemenchante = new ItemStack(swordFantasy, 1, 0); itemenchante.addEnchantment(Enchantment.knockback, 5 + 5 + 5); itemenchante.addEnchantment(Enchantment.looting, 2); itemenchante.addEnchantment(Enchantment.baneOfArthropods, 2); itemenchante.addEnchantment(Enchantment.sharpness, 5); itemenchante.addEnchantment(Enchantment.smite, 4); GameRegistry.addRecipe(new ItemStack(helmetFantasy), new Object[] {"XXX", "X X", " ", 'X', FantasyMod.fantasyIngot}); GameRegistry.addRecipe(new ItemStack(chestPlateFantasy), new Object[] {"X X", "XXX", "XXX", 'X', FantasyMod.fantasyIngot}); GameRegistry.addRecipe(new ItemStack(leggingsFantasy), new Object[] {"XXX", "X X", "X X", 'X', FantasyMod.fantasyIngot}); GameRegistry.addRecipe(new ItemStack(bootsFantasy), new Object[] {" ", "X X", "X X", 'X', FantasyMod.fantasyIngot}); GameRegistry.addRecipe(itemenchante, new Object[] {" X", " Y ", "Z ", 'X', FantasyMod.HautEpee, 'Y', new ItemStack(FantasyMod.MilieuEpee), 'Z', new ItemStack(FantasyMod.MancheEpee),}); GameRegistry.addRecipe(new ItemStack(pickaxeFantasy), new Object[] {"XXX", " Y ", " Y ", 'X', FantasyMod.fantasyIngot, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(axeFantasy), new Object[] {" XX", " YX", " Y ", 'X', FantasyMod.fantasyIngot, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(shovelFantasy), new Object[] {" X ", " Y ", " Y ", 'X', FantasyMod.fantasyIngot, 'Y', new ItemStack(Items.stick),}); GameRegistry.addRecipe(new ItemStack(hoeFantasy), new Object[] {"XX ", " Y ", " Y ", 'X', FantasyMod.fantasyIngot, 'Y', new ItemStack(Items.stick),}); // Stackizer GameRegistry.addRecipe(new ItemStack(Waterstack), new Object[] {"XXX", "XXX", "XXX", 'X', Items.water_bucket}); // Waterstack GameRegistry.addShapelessRecipe(new ItemStack(Items.water_bucket, 9), new Object[] {new ItemStack(FantasyMod.Waterstack)}); // 9 WaterBucket GameRegistry.addRecipe(new ItemStack(Lavastack), new Object[] {"XXX", "XXX", "XXX", 'X', Items.lava_bucket}); // Lavastack GameRegistry.addShapelessRecipe(new ItemStack(Items.lava_bucket, 9), new Object[] {new ItemStack(FantasyMod.Lavastack)}); // 9 LavaBucket GameRegistry.addRecipe(new ItemStack(Milkstack), new Object[] {"XXX", "XXX", "XXX", 'X', Items.milk_bucket}); // Milkstack GameRegistry.addShapelessRecipe(new ItemStack(Items.milk_bucket, 9), new Object[] {new ItemStack(FantasyMod.Milkstack)}); // 9 MilkBucket // Parts GameRegistry.addRecipe(new ItemStack(MancheEpee), new Object[] {" Y", " Y ", "X ", 'X', FantasyMod.fantasyIngot, 'Y', new ItemStack(Items.stick),}); // Manche Epee GameRegistry.addRecipe(new ItemStack(MilieuEpee), new Object[] {"X X", " X ", " ", 'X', FantasyMod.fantasyIngot,}); // Milieu Epee GameRegistry.addRecipe(new ItemStack(HautEpee), new Object[] {" X ", "XYX", "XYX", 'X', FantasyMod.fantasyIngot, 'Y', new ItemStack(Items.diamond),}); // Haut Epee fantasyBiome = new fantasyBiome(40).setBiomeName("Biome Fantasy").setDisableRain().setTemperatureRainfall(1.2F, 0.9F).setEnableSnow(); BiomeManager.addSpawnBiome(fantasyBiome); } @EventHandler public void postInit(FMLPostInitializationEvent event) { } public void addEntity(Class entityClass, String name, int id, int backgroundEggColour, int foregroundEggColour, int freq, int min, int max, EnumCreatureType typeOfTheCreature) { EntityRegistry.registerGlobalEntityID(entityClass, name, EntityRegistry.findGlobalUniqueEntityId(), backgroundEggColour, foregroundEggColour); EntityRegistry.registerModEntity(entityClass, name, id, this, 40, 1, true); EntityRegistry.addSpawn((Class)entityClass, freq, min, max, typeOfTheCreature, allBiomes); } }
:::
:::package fr.monpetitflocon.fantasymod.common; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.biome.BiomeGenBase; import net.minecraft.world.gen.feature.WorldGenTrees; import net.minecraft.world.gen.feature.WorldGenerator; public class fantasyBiome extends BiomeGenBase { public fantasyBiome(int par1) { super(par1); this.topBlock = (Block)Blocks.grass; this.fillerBlock = (Block)Blocks.glass; this.theBiomeDecorator.treesPerChunk = 10; this.theBiomeDecorator.reedsPerChunk = 50; this.theBiomeDecorator.generateLakes = true; this.waterColorMultiplier = 0xFF0022; } public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { return (WorldGenerator)(par1Random.nextInt(5) == 0 ? new WorldGenTrees(false, 4, 2, 2, false) : (par1Random.nextInt(10) == 0 ? this.worldGeneratorBigTree : new WorldGenTrees(false, 4, 0, 0, false))); } public int getBiomeGrassColor() { return 0xFF0C00; } }
:::
merci de me dire si le code est bon car je n’ai aucune erreur et je prefere attendree vos reponse avant de lancer le jeu
-
Il y a tout ce qu’il faut dans ce tutoriel : http://www.minecraftforgefrance.fr/showthread.php?tid=1108
Dedans il y a : Dimension, providers, biome, etc.
-
pour les biomes y a une petite partit dessus ici : http://www.minecraftforgefrance.fr/showthread.php?tid=1096