Résolu Régler le taux de spawn des mobs
-
Bonjour à tous, c’est encore une fois moi.
Aujourd’hui je n’arrive pas à réguler le taux de spawn de mes entités. Il y en a beaucoup trop.
J’ai beau changer les trois valeurs : weightedProb, min, max, mais rien ne changepackage fr.hard.mod.Handlers; import fr.hard.mod.Hardcore; import fr.hard.mod.Entity.EntityAssassin; import fr.hard.mod.Entity.EntityBandit; import fr.hard.mod.Entity.EntityHerobrine; import fr.hard.mod.Entity.EntityHuman; import fr.hard.mod.Entity.EntityHunter; import fr.hard.mod.Entity.EntityKnight; import fr.hard.mod.Entity.EntityLostMiner; import fr.hard.mod.Entity.EntityPirate; import fr.hard.mod.Entity.EntityPreacher; import fr.hard.mod.Entity.EntityRogue; import fr.hard.mod.Entity.EntityRogueArcher; import fr.hard.mod.Entity.EntitySamurai; import fr.hard.mod.Entity.EntityShadow; import fr.hard.mod.Models.ModelAssassin; import fr.hard.mod.Models.ModelBandit; import fr.hard.mod.Models.ModelHerobrine; import fr.hard.mod.Models.ModelHuman; import fr.hard.mod.Models.ModelHunter; import fr.hard.mod.Models.ModelKnight; import fr.hard.mod.Models.ModelLostMiner; import fr.hard.mod.Models.ModelPirate; import fr.hard.mod.Models.ModelPreacher; import fr.hard.mod.Models.ModelRogue; import fr.hard.mod.Models.ModelRogueArcher; import fr.hard.mod.Models.ModelSamurai; import fr.hard.mod.Models.ModelShadow; import fr.hard.mod.Render.RenderAssassin; import fr.hard.mod.Render.RenderBandit; import fr.hard.mod.Render.RenderHerobrine; import fr.hard.mod.Render.RenderHuman; import fr.hard.mod.Render.RenderHunter; import fr.hard.mod.Render.RenderKnight; import fr.hard.mod.Render.RenderLostMiner; import fr.hard.mod.Render.RenderPirate; import fr.hard.mod.Render.RenderPreacher; import fr.hard.mod.Render.RenderRogue; import fr.hard.mod.Render.RenderRogueArcher; import fr.hard.mod.Render.RenderSamurai; import fr.hard.mod.Render.RenderShadow; import net.minecraft.client.Minecraft; import net.minecraft.entity.EntityList; import net.minecraft.entity.EnumCreatureType; import net.minecraft.init.Biomes; import net.minecraft.world.biome.Biome; import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.fml.client.registry.RenderingRegistry; import net.minecraftforge.fml.common.registry.EntityRegistry; public class EntityHandler { public static void register() { EntityHandler.registerRender(); EntityHandler.registerEntity(); } public static void registerRender() { RenderingRegistry.registerEntityRenderingHandler(EntityPreacher.class, new RenderPreacher(Minecraft.getMinecraft().getRenderManager(), new ModelPreacher(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityAssassin.class, new RenderAssassin(Minecraft.getMinecraft().getRenderManager(), new ModelAssassin(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityHerobrine.class, new RenderHerobrine(Minecraft.getMinecraft().getRenderManager(), new ModelHerobrine(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityHuman.class, new RenderHuman(Minecraft.getMinecraft().getRenderManager(), new ModelHuman(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityHunter.class, new RenderHunter(Minecraft.getMinecraft().getRenderManager(), new ModelHunter(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityKnight.class, new RenderKnight(Minecraft.getMinecraft().getRenderManager(), new ModelKnight(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityPirate.class, new RenderPirate(Minecraft.getMinecraft().getRenderManager(), new ModelPirate(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityRogue.class, new RenderRogue(Minecraft.getMinecraft().getRenderManager(), new ModelRogue(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntitySamurai.class, new RenderSamurai(Minecraft.getMinecraft().getRenderManager(), new ModelSamurai(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityShadow.class, new RenderShadow(Minecraft.getMinecraft().getRenderManager(), new ModelShadow(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityBandit.class, new RenderBandit(Minecraft.getMinecraft().getRenderManager(), new ModelBandit(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityRogueArcher.class, new RenderRogueArcher(Minecraft.getMinecraft().getRenderManager(), new ModelRogueArcher(), 0.5F)); RenderingRegistry.registerEntityRenderingHandler(EntityLostMiner.class, new RenderLostMiner(Minecraft.getMinecraft().getRenderManager(), new ModelLostMiner(), 0.5F)); } public static void registerEntity() { EntityRegistry.registerModEntity(EntityPreacher.class, "preacher", 300, Hardcore.instance, 32, 1, true, 0xf8f8f8, 0x202421); EntityRegistry.addSpawn(EntityPreacher.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.COLD_BEACH, Biomes.COLD_TAIGA, Biomes.COLD_TAIGA_HILLS, Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.FROZEN_RIVER, Biomes.ICE_MOUNTAINS, Biomes.ICE_PLAINS, Biomes.JUNGLE, Biomes.JUNGLE_EDGE, Biomes.JUNGLE_HILLS, Biomes.MESA, Biomes.MESA_CLEAR_ROCK, Biomes.MESA_ROCK, Biomes.MUTATED_BIRCH_FOREST, Biomes.MUTATED_BIRCH_FOREST_HILLS, Biomes.PLAINS, Biomes.REDWOOD_TAIGA, Biomes.REDWOOD_TAIGA_HILLS, Biomes.RIVER, Biomes.ROOFED_FOREST, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.STONE_BEACH, Biomes.SWAMPLAND, Biomes.TAIGA, Biomes.TAIGA_HILLS); EntityRegistry.registerModEntity(EntityAssassin.class, "assassin", 301, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntityAssassin.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.COLD_BEACH, Biomes.COLD_TAIGA, Biomes.COLD_TAIGA_HILLS, Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.FROZEN_RIVER, Biomes.ICE_MOUNTAINS, Biomes.ICE_PLAINS, Biomes.JUNGLE, Biomes.JUNGLE_EDGE, Biomes.JUNGLE_HILLS, Biomes.MESA, Biomes.MESA_CLEAR_ROCK, Biomes.MESA_ROCK, Biomes.MUTATED_BIRCH_FOREST, Biomes.MUTATED_BIRCH_FOREST_HILLS, Biomes.PLAINS, Biomes.REDWOOD_TAIGA, Biomes.REDWOOD_TAIGA_HILLS, Biomes.RIVER, Biomes.ROOFED_FOREST, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.STONE_BEACH, Biomes.SWAMPLAND, Biomes.TAIGA, Biomes.TAIGA_HILLS); EntityRegistry.registerModEntity(EntityHerobrine.class, "herobrine", 302, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntityHerobrine.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.HELL); EntityRegistry.registerModEntity(EntityHuman.class, "human", 303, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntityHuman.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.COLD_BEACH, Biomes.COLD_TAIGA, Biomes.COLD_TAIGA_HILLS, Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.FROZEN_RIVER, Biomes.ICE_MOUNTAINS, Biomes.ICE_PLAINS, Biomes.JUNGLE, Biomes.JUNGLE_EDGE, Biomes.JUNGLE_HILLS, Biomes.MESA, Biomes.MESA_CLEAR_ROCK, Biomes.MESA_ROCK, Biomes.MUTATED_BIRCH_FOREST, Biomes.MUTATED_BIRCH_FOREST_HILLS, Biomes.PLAINS, Biomes.REDWOOD_TAIGA, Biomes.REDWOOD_TAIGA_HILLS, Biomes.RIVER, Biomes.ROOFED_FOREST, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.STONE_BEACH, Biomes.SWAMPLAND, Biomes.TAIGA, Biomes.TAIGA_HILLS); EntityRegistry.registerModEntity(EntityHunter.class, "hunter", 304, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntityHunter.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.COLD_BEACH, Biomes.COLD_TAIGA, Biomes.COLD_TAIGA_HILLS, Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.FROZEN_RIVER, Biomes.ICE_MOUNTAINS, Biomes.ICE_PLAINS, Biomes.JUNGLE, Biomes.JUNGLE_EDGE, Biomes.JUNGLE_HILLS, Biomes.MESA, Biomes.MESA_CLEAR_ROCK, Biomes.MESA_ROCK, Biomes.MUTATED_BIRCH_FOREST, Biomes.MUTATED_BIRCH_FOREST_HILLS, Biomes.PLAINS, Biomes.REDWOOD_TAIGA, Biomes.REDWOOD_TAIGA_HILLS, Biomes.RIVER, Biomes.ROOFED_FOREST, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.STONE_BEACH, Biomes.SWAMPLAND, Biomes.TAIGA, Biomes.TAIGA_HILLS); EntityRegistry.registerModEntity(EntityKnight.class, "knight", 305, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntityKnight.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.COLD_BEACH, Biomes.COLD_TAIGA, Biomes.COLD_TAIGA_HILLS, Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.FROZEN_RIVER, Biomes.ICE_MOUNTAINS, Biomes.ICE_PLAINS, Biomes.JUNGLE, Biomes.JUNGLE_EDGE, Biomes.JUNGLE_HILLS, Biomes.MESA, Biomes.MESA_CLEAR_ROCK, Biomes.MESA_ROCK, Biomes.MUTATED_BIRCH_FOREST, Biomes.MUTATED_BIRCH_FOREST_HILLS, Biomes.PLAINS, Biomes.REDWOOD_TAIGA, Biomes.REDWOOD_TAIGA_HILLS, Biomes.RIVER, Biomes.ROOFED_FOREST, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.STONE_BEACH, Biomes.SWAMPLAND, Biomes.TAIGA, Biomes.TAIGA_HILLS); EntityRegistry.registerModEntity(EntityPirate.class, "pirate", 306, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntityPirate.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN); EntityRegistry.registerModEntity(EntityRogue.class, "rogue", 307, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntityRogue.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.COLD_BEACH, Biomes.COLD_TAIGA, Biomes.COLD_TAIGA_HILLS, Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.FROZEN_RIVER, Biomes.ICE_MOUNTAINS, Biomes.ICE_PLAINS, Biomes.JUNGLE, Biomes.JUNGLE_EDGE, Biomes.JUNGLE_HILLS, Biomes.MESA, Biomes.MESA_CLEAR_ROCK, Biomes.MESA_ROCK, Biomes.MUTATED_BIRCH_FOREST, Biomes.MUTATED_BIRCH_FOREST_HILLS, Biomes.PLAINS, Biomes.REDWOOD_TAIGA, Biomes.REDWOOD_TAIGA_HILLS, Biomes.RIVER, Biomes.ROOFED_FOREST, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.STONE_BEACH, Biomes.SWAMPLAND, Biomes.TAIGA, Biomes.TAIGA_HILLS); EntityRegistry.registerModEntity(EntityRogueArcher.class, "roguearcher", 308, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntityRogueArcher.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.COLD_BEACH, Biomes.COLD_TAIGA, Biomes.COLD_TAIGA_HILLS, Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.FROZEN_RIVER, Biomes.ICE_MOUNTAINS, Biomes.ICE_PLAINS, Biomes.JUNGLE, Biomes.JUNGLE_EDGE, Biomes.JUNGLE_HILLS, Biomes.MESA, Biomes.MESA_CLEAR_ROCK, Biomes.MESA_ROCK, Biomes.MUTATED_BIRCH_FOREST, Biomes.MUTATED_BIRCH_FOREST_HILLS, Biomes.PLAINS, Biomes.REDWOOD_TAIGA, Biomes.REDWOOD_TAIGA_HILLS, Biomes.RIVER, Biomes.ROOFED_FOREST, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.STONE_BEACH, Biomes.SWAMPLAND, Biomes.TAIGA, Biomes.TAIGA_HILLS); EntityRegistry.registerModEntity(EntitySamurai.class, "samurai", 309, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntitySamurai.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.COLD_BEACH, Biomes.COLD_TAIGA, Biomes.COLD_TAIGA_HILLS, Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.FROZEN_RIVER, Biomes.ICE_MOUNTAINS, Biomes.ICE_PLAINS, Biomes.JUNGLE, Biomes.JUNGLE_EDGE, Biomes.JUNGLE_HILLS, Biomes.MESA, Biomes.MESA_CLEAR_ROCK, Biomes.MESA_ROCK, Biomes.MUTATED_BIRCH_FOREST, Biomes.MUTATED_BIRCH_FOREST_HILLS, Biomes.PLAINS, Biomes.REDWOOD_TAIGA, Biomes.REDWOOD_TAIGA_HILLS, Biomes.RIVER, Biomes.ROOFED_FOREST, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.STONE_BEACH, Biomes.SWAMPLAND, Biomes.TAIGA, Biomes.TAIGA_HILLS); EntityRegistry.registerModEntity(EntityShadow.class, "shadow", 310, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntityShadow.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.HELL); EntityRegistry.registerModEntity(EntityBandit.class, "bandit", 311, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntityBandit.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.COLD_BEACH, Biomes.COLD_TAIGA, Biomes.COLD_TAIGA_HILLS, Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.FROZEN_RIVER, Biomes.ICE_MOUNTAINS, Biomes.ICE_PLAINS, Biomes.JUNGLE, Biomes.JUNGLE_EDGE, Biomes.JUNGLE_HILLS, Biomes.MESA, Biomes.MESA_CLEAR_ROCK, Biomes.MESA_ROCK, Biomes.MUTATED_BIRCH_FOREST, Biomes.MUTATED_BIRCH_FOREST_HILLS, Biomes.PLAINS, Biomes.REDWOOD_TAIGA, Biomes.REDWOOD_TAIGA_HILLS, Biomes.RIVER, Biomes.ROOFED_FOREST, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.STONE_BEACH, Biomes.SWAMPLAND, Biomes.TAIGA, Biomes.TAIGA_HILLS); EntityRegistry.registerModEntity(EntityLostMiner.class, "lostminer", 312, Hardcore.instance, 32, 1, true, 0xf7f7f7, 0x202421); EntityRegistry.addSpawn(EntityLostMiner.class, 1, 1, 1, EnumCreatureType.AMBIENT, Biomes.BEACH, Biomes.BIRCH_FOREST, Biomes.BIRCH_FOREST_HILLS, Biomes.COLD_BEACH, Biomes.COLD_TAIGA, Biomes.COLD_TAIGA_HILLS, Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.FOREST, Biomes.FOREST_HILLS, Biomes.FROZEN_RIVER, Biomes.ICE_MOUNTAINS, Biomes.ICE_PLAINS, Biomes.JUNGLE, Biomes.JUNGLE_EDGE, Biomes.JUNGLE_HILLS, Biomes.MESA, Biomes.MESA_CLEAR_ROCK, Biomes.MESA_ROCK, Biomes.MUTATED_BIRCH_FOREST, Biomes.MUTATED_BIRCH_FOREST_HILLS, Biomes.PLAINS, Biomes.REDWOOD_TAIGA, Biomes.REDWOOD_TAIGA_HILLS, Biomes.RIVER, Biomes.ROOFED_FOREST, Biomes.SAVANNA, Biomes.SAVANNA_PLATEAU, Biomes.STONE_BEACH, Biomes.SWAMPLAND, Biomes.TAIGA, Biomes.TAIGA_HILLS); } }
Merci!
-
Salut, la balise java, please, on a trop de lignes à scroll autrement.
Autrement, je ne vois aucun soucis dans ton code, peut-être que le problème de tes classes entity au cas où tu aurais surchargé la méthode getMaxSpawnedInChunk avec une trop grosse valeur ? Ou cela peut aussi être causé par un plugin mal configuré, si tu fais tes tests hors vanilla, non ? -
Merci, cela régule bel et bien le taux de spawn!
@Override public int getMaxSpawnedInChunk() { return 1; }
-
(penses à utiliser la balise java au lieu de la balise code pour du code java afin d’avoir les couleurs).