Allowed the player to spawn in BOP biomes

This commit is contained in:
Forstride 2019-05-22 02:46:35 -04:00
parent 92809f3092
commit fbd92d83d5
10 changed files with 21 additions and 0 deletions

View File

@ -16,10 +16,12 @@ import java.util.Map;
public class BiomeBOP extends Biome
{
protected Map<BOPClimates, Integer> weightMap = new HashMap<BOPClimates, Integer>();
public boolean canSpawnInBiome;
public BiomeBOP(BiomeBuilder builder)
{
super(builder);
this.canSpawnInBiome = true;
}
public void addWeight(BOPClimates climate, int weight)

View File

@ -110,6 +110,7 @@ public class MysticGroveBiome extends BiomeBOP
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.WITCH, 5, 1, 1));
this.addWeight(BOPClimates.WET_TEMPERATE, 1);
this.canSpawnInBiome = false;
}
@OnlyIn(Dist.CLIENT)

View File

@ -103,6 +103,7 @@ public class OminousWoodsBiome extends BiomeBOP
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.WITCH, 5, 1, 1));
this.addWeight(BOPClimates.WET_BOREAL, 1);
this.canSpawnInBiome = false;
}
@OnlyIn(Dist.CLIENT)

View File

@ -77,6 +77,8 @@ public class OriginBeachBiome extends BiomeBOP
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.SKELETON, 100, 4, 4));
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.CREEPER, 100, 4, 4));
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.SLIME, 100, 4, 4));
this.canSpawnInBiome = false;
}
@OnlyIn(Dist.CLIENT)

View File

@ -80,6 +80,8 @@ public class OriginHillsBiome extends BiomeBOP
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.SKELETON, 100, 4, 4));
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.CREEPER, 100, 4, 4));
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.SLIME, 100, 4, 4));
this.canSpawnInBiome = false;
}
@OnlyIn(Dist.CLIENT)

View File

@ -90,6 +90,8 @@ public class TropicsBiome extends BiomeBOP
// Entity spawning
this.addSpawn(EnumCreatureType.CREATURE, new Biome.SpawnListEntry(EntityType.PIG, 10, 4, 4));
this.addSpawn(EnumCreatureType.CREATURE, new Biome.SpawnListEntry(EntityType.PARROT, 40, 1, 2));
this.canSpawnInBiome = false;
}
@OnlyIn(Dist.CLIENT)

View File

@ -89,5 +89,7 @@ public class VolcanoBiome extends BiomeBOP
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.SLIME, 100, 4, 4));
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.ENDERMAN, 10, 1, 4));
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.WITCH, 5, 1, 1));
this.canSpawnInBiome = false;
}
}

View File

@ -93,6 +93,7 @@ public class WastelandBiome extends BiomeBOP
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.WITCH, 5, 1, 1));
this.addWeight(BOPClimates.HOT_DESERT, 1);
this.canSpawnInBiome = false;
}
@OnlyIn(Dist.CLIENT)

View File

@ -86,5 +86,7 @@ public class WhiteBeachBiome extends BiomeBOP
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.SLIME, 100, 4, 4));
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.ENDERMAN, 10, 1, 4));
this.addSpawn(EnumCreatureType.MONSTER, new Biome.SpawnListEntry(EntityType.WITCH, 5, 1, 1));
this.canSpawnInBiome = false;
}
}

View File

@ -76,6 +76,7 @@ import net.minecraft.util.registry.IRegistry;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.common.BiomeDictionary.Type;
import net.minecraftforge.common.BiomeManager;
import net.minecraftforge.registries.ForgeRegistries;
import java.util.Map;
@ -240,6 +241,11 @@ public class ModBiomes
{
biome.setRegistryName(name);
ForgeRegistries.BIOMES.register(biome);
if (biome.canSpawnInBiome)
{
BiomeManager.addSpawnBiome(biome);
}
for (Map.Entry<BOPClimates, Integer> entry : biome.getWeightMap().entrySet())
{