本文整理汇总了Java中net.minecraft.world.gen.structure.MapGenVillage类的典型用法代码示例。如果您正苦于以下问题:Java MapGenVillage类的具体用法?Java MapGenVillage怎么用?Java MapGenVillage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MapGenVillage类属于net.minecraft.world.gen.structure包,在下文中一共展示了MapGenVillage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setRules
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
protected void setRules() {
ClimateControlRules newRules = new ClimateControlRules();
newRules = new ClimateControlRules();
for (BiomeSettings biomeSettings: settings().biomeSettings()) {
biomeSettings.setRules(newRules);
}
List<Biome> villageSpawnBiomes = new ArrayList<Biome>();
for (int i = 0 ; i < 256;i++) {
if (newRules.hasVillages(i)) {
villageSpawnBiomes.add(Biome.getBiome(i));
}
}
VillageBiomes villageBiomes = new VillageBiomes(villageSpawnBiomes);
villageBiomes.reportMembers();
if (settings.controlVillageBiomes.value()) {
MapGenVillage.VILLAGE_SPAWN_BIOMES = villageBiomes;
}
rules = newRules;
}
示例2: onInitMapGenEvent
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
@SubscribeEvent
public void onInitMapGenEvent(final InitMapGenEvent event) {
// Hook village generation
if (event.type == EventType.VILLAGE && event.newGen instanceof MapGenVillage) {
final MapGenVillage village = (MapGenVillage) event.newGen;
int t = ModOptions.getVillageDensity();
if (t > 0)
village.field_82665_g = t;
t = ModOptions.getMinimumVillageDistance();
if (t > 0)
village.field_82666_h = t;
ModLog.debug("Village parameters: %d density, %d distance", village.field_82665_g, village.field_82666_h);
}
}
示例3: postInit
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
public void postInit(final FMLPostInitializationEvent event) {
Assets.initialize();
// Patch up the village biome list with the configured
// settings. We need to create a new map because
// the one that is there is immutable.
final int[] additional = ModOptions.getAdditionalVillageBiomes();
if(additional.length > 0) {
final List<BiomeGenBase> newList = new ArrayList<BiomeGenBase>();
newList.addAll(MapGenVillage.villageSpawnBiomes);
for(final int biomeId: additional) {
final BiomeGenBase biome = BiomeGenBase.getBiome(biomeId);
if(biome != null)
newList.add(biome);
}
MapGenVillage.villageSpawnBiomes = newList;
}
// Initialize themes
if(ModOptions.getEnableTheming())
BlockThemes.initialize();
MobControl.initialize();
}
示例4: func_75077_d
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
private static StructureComponent func_75077_d(ComponentVillageStartPiece p_75077_0_, List p_75077_1_, Random p_75077_2_, int p_75077_3_, int p_75077_4_, int p_75077_5_, int p_75077_6_, int p_75077_7_) {
if(p_75077_7_ > 50) {
return null;
} else if(Math.abs(p_75077_3_ - p_75077_0_.func_74874_b().field_78897_a) <= 112 && Math.abs(p_75077_5_ - p_75077_0_.func_74874_b().field_78896_c) <= 112) {
ComponentVillage var8 = func_75081_c(p_75077_0_, p_75077_1_, p_75077_2_, p_75077_3_, p_75077_4_, p_75077_5_, p_75077_6_, p_75077_7_ + 1);
if(var8 != null) {
int var9 = (var8.field_74887_e.field_78897_a + var8.field_74887_e.field_78893_d) / 2;
int var10 = (var8.field_74887_e.field_78896_c + var8.field_74887_e.field_78892_f) / 2;
int var11 = var8.field_74887_e.field_78893_d - var8.field_74887_e.field_78897_a;
int var12 = var8.field_74887_e.field_78892_f - var8.field_74887_e.field_78896_c;
int var13 = var11 > var12?var11:var12;
if(p_75077_0_.func_74925_d().func_76940_a(var9, var10, var13 / 2 + 4, MapGenVillage.field_75055_e)) {
p_75077_1_.add(var8);
p_75077_0_.field_74932_i.add(var8);
return var8;
}
}
return null;
} else {
return null;
}
}
示例5: func_75080_e
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
private static StructureComponent func_75080_e(ComponentVillageStartPiece p_75080_0_, List p_75080_1_, Random p_75080_2_, int p_75080_3_, int p_75080_4_, int p_75080_5_, int p_75080_6_, int p_75080_7_) {
if(p_75080_7_ > 3 + p_75080_0_.field_74928_c) {
return null;
} else if(Math.abs(p_75080_3_ - p_75080_0_.func_74874_b().field_78897_a) <= 112 && Math.abs(p_75080_5_ - p_75080_0_.func_74874_b().field_78896_c) <= 112) {
StructureBoundingBox var8 = ComponentVillagePathGen.func_74933_a(p_75080_0_, p_75080_1_, p_75080_2_, p_75080_3_, p_75080_4_, p_75080_5_, p_75080_6_);
if(var8 != null && var8.field_78895_b > 10) {
ComponentVillagePathGen var9 = new ComponentVillagePathGen(p_75080_0_, p_75080_7_, p_75080_2_, var8, p_75080_6_);
int var10 = (var9.field_74887_e.field_78897_a + var9.field_74887_e.field_78893_d) / 2;
int var11 = (var9.field_74887_e.field_78896_c + var9.field_74887_e.field_78892_f) / 2;
int var12 = var9.field_74887_e.field_78893_d - var9.field_74887_e.field_78897_a;
int var13 = var9.field_74887_e.field_78892_f - var9.field_74887_e.field_78896_c;
int var14 = var12 > var13?var12:var13;
if(p_75080_0_.func_74925_d().func_76940_a(var10, var11, var14 / 2 + 4, MapGenVillage.field_75055_e)) {
p_75080_1_.add(var9);
p_75080_0_.field_74930_j.add(var9);
return var9;
}
}
return null;
} else {
return null;
}
}
示例6: addVillageBiome
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
public static void addVillageBiome(Biome biome, boolean canSpawn)
{
if (!MapGenVillage.VILLAGE_SPAWN_BIOMES.contains(biome))
{
ArrayList<Biome> biomes = new ArrayList<Biome>(MapGenVillage.VILLAGE_SPAWN_BIOMES);
biomes.add(biome);
MapGenVillage.VILLAGE_SPAWN_BIOMES = biomes;
}
}
示例7: removeVillageBiome
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
public static void removeVillageBiome(Biome biome)
{
if (MapGenVillage.VILLAGE_SPAWN_BIOMES.contains(biome))
{
ArrayList<Biome> biomes = new ArrayList<Biome>(MapGenVillage.VILLAGE_SPAWN_BIOMES);
biomes.remove(biome);
MapGenVillage.VILLAGE_SPAWN_BIOMES = biomes;
}
}
示例8: addVillageBiome
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void addVillageBiome(BiomeGenBase biome, boolean canSpawn)
{
if (!MapGenVillage.field_75055_e.contains(biome))
{
ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.field_75055_e);
biomes.add(biome);
MapGenVillage.field_75055_e = biomes;
}
}
示例9: removeVillageBiome
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void removeVillageBiome(BiomeGenBase biome)
{
if (MapGenVillage.field_75055_e.contains(biome))
{
ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.field_75055_e);
biomes.remove(biome);
MapGenVillage.field_75055_e = biomes;
}
}
示例10: cancelVillage
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
/** Alters vanilla structure generation. */
@SubscribeEvent
public void cancelVillage(InitMapGenEvent event) {
// Cancel any village generation
if (event.getType() == EventType.VILLAGE) {
event.setNewGen(new MapGenVillage() {
@Override
public void generate(World world, int x,
int z, ChunkPrimer primer) {}
});
}
}
示例11: getNextVillageStructureComponent
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
/**
* attempts to find a next Structure Component to be spawned, private Village function
*/
private static StructureComponent getNextVillageStructureComponent(StructureVillagePieces.Start p_75077_0_, List p_75077_1_, Random p_75077_2_, int p_75077_3_, int p_75077_4_, int p_75077_5_, int p_75077_6_, int p_75077_7_)
{
if (p_75077_7_ > 50)
{
return null;
}
else if (Math.abs(p_75077_3_ - p_75077_0_.getBoundingBox().minX) <= 112 && Math.abs(p_75077_5_ - p_75077_0_.getBoundingBox().minZ) <= 112)
{
StructureVillagePieces.Village village = getNextVillageComponent(p_75077_0_, p_75077_1_, p_75077_2_, p_75077_3_, p_75077_4_, p_75077_5_, p_75077_6_, p_75077_7_ + 1);
if (village != null)
{
int j1 = (village.getBoundingBox().minX + village.getBoundingBox().maxX) / 2;
int k1 = (village.getBoundingBox().minZ + village.getBoundingBox().maxZ) / 2;
int l1 = village.getBoundingBox().maxX - village.getBoundingBox().minX;
int i2 = village.getBoundingBox().maxZ - village.getBoundingBox().minZ;
int j2 = l1 > i2 ? l1 : i2;
if (p_75077_0_.getWorldChunkManager().areBiomesViable(j1, k1, j2 / 2 + 4, MapGenVillage.villageSpawnBiomes))
{
p_75077_1_.add(village);
p_75077_0_.field_74932_i.add(village);
return village;
}
}
return null;
}
else
{
return null;
}
}
示例12: getNextComponentVillagePath
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
private static StructureComponent getNextComponentVillagePath(StructureVillagePieces.Start p_75080_0_, List p_75080_1_, Random p_75080_2_, int p_75080_3_, int p_75080_4_, int p_75080_5_, int p_75080_6_, int p_75080_7_)
{
if (p_75080_7_ > 3 + p_75080_0_.terrainType)
{
return null;
}
else if (Math.abs(p_75080_3_ - p_75080_0_.getBoundingBox().minX) <= 112 && Math.abs(p_75080_5_ - p_75080_0_.getBoundingBox().minZ) <= 112)
{
StructureBoundingBox structureboundingbox = StructureVillagePieces.Path.func_74933_a(p_75080_0_, p_75080_1_, p_75080_2_, p_75080_3_, p_75080_4_, p_75080_5_, p_75080_6_);
if (structureboundingbox != null && structureboundingbox.minY > 10)
{
StructureVillagePieces.Path path = new StructureVillagePieces.Path(p_75080_0_, p_75080_7_, p_75080_2_, structureboundingbox, p_75080_6_);
int j1 = (path.getBoundingBox().minX + path.getBoundingBox().maxX) / 2;
int k1 = (path.getBoundingBox().minZ + path.getBoundingBox().maxZ) / 2;
int l1 = path.getBoundingBox().maxX - path.getBoundingBox().minX;
int i2 = path.getBoundingBox().maxZ - path.getBoundingBox().minZ;
int j2 = l1 > i2 ? l1 : i2;
if (p_75080_0_.getWorldChunkManager().areBiomesViable(j1, k1, j2 / 2 + 4, MapGenVillage.villageSpawnBiomes))
{
p_75080_1_.add(path);
p_75080_0_.field_74930_j.add(path);
return path;
}
}
return null;
}
else
{
return null;
}
}
示例13: addVillageBiome
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void addVillageBiome(BiomeGenBase biome, boolean canSpawn)
{
if (!MapGenVillage.villageSpawnBiomes.contains(biome))
{
ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.villageSpawnBiomes);
biomes.add(biome);
MapGenVillage.villageSpawnBiomes = biomes;
}
}
示例14: removeVillageBiome
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void removeVillageBiome(BiomeGenBase biome)
{
if (MapGenVillage.villageSpawnBiomes.contains(biome))
{
ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.villageSpawnBiomes);
biomes.remove(biome);
MapGenVillage.villageSpawnBiomes = biomes;
}
}
示例15: addVillageBiome
import net.minecraft.world.gen.structure.MapGenVillage; //导入依赖的package包/类
public static void addVillageBiome(BiomeGenBase biome, boolean canSpawn)
{
if (!MapGenVillage.villageSpawnBiomes.contains(biome))
{
ArrayList<BiomeGenBase> biomes = new ArrayList<BiomeGenBase>(MapGenVillage.villageSpawnBiomes);
biomes.add(biome);
MapGenVillage.villageSpawnBiomes = biomes;
}
}