本文整理了Java中net.minecraft.world.World.getBiome()
方法的一些代码示例,展示了World.getBiome()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。World.getBiome()
方法的具体详情如下:
包路径:net.minecraft.world.World
类名称:World
方法名:getBiome
暂无
代码示例来源:origin: Vazkii/Botania
public IBlockState getStoneToPut(BlockPos coords) {
Set<Type> types = BiomeDictionary.getTypes(supertile.getWorld().getBiome(coords));
TIntArrayList values = new TIntArrayList();
for(int i = 0; i < TYPES.length; i++) {
int times = 1;
if(types.contains(TYPES[i]))
times = 12;
for(int j = 0; j < times; j++)
values.add(i);
}
int meta = values.get(supertile.getWorld().rand.nextInt(values.size()));
BiomeStoneVariant variant = BiomeStoneVariant.values()[meta];
return ModFluffBlocks.biomeStoneA.getDefaultState().withProperty(BotaniaStateProps.BIOMESTONE_VARIANT, variant);
}
代码示例来源:origin: Vazkii/Botania
@Override
public int getDelayBetweenPassiveGeneration() {
boolean rain = supertile.getWorld().getBiome(supertile.getPos()).getRainfall() > 0 && (supertile.getWorld().isRaining() || supertile.getWorld().isThundering());
return rain ? 2 : 3;
}
代码示例来源:origin: Vazkii/Botania
if(event.getWorld().provider instanceof IFlowerlessWorld)
flowers = ((IFlowerlessWorld) event.getWorld().provider).generateFlowers(event.getWorld());
else if(event.getWorld().getBiome(pos) instanceof IFlowerlessBiome)
flowers = ((IFlowerlessBiome) event.getWorld().getBiome(pos)).canGenerateFlowers(event.getWorld(), pos.getX(), pos.getZ());
代码示例来源:origin: SleepyTrousers/EnderIO
@Override
public @Nonnull Biome getBiome(@Nonnull BlockPos pos) {
return wrapped.getBiome(pos);
}
代码示例来源:origin: ForestryMC/ForestryMC
@Override
public Biome getBiome() {
BlockPos coords = getReferenceCoord();
return world.getBiome(coords);
}
代码示例来源:origin: ForestryMC/ForestryMC
@Override
public boolean isAcceptableFlower(IBlockState blockState, World world, BlockPos pos, String flowerType) {
Biome biomeGenForCoords = world.getBiome(pos);
return BiomeDictionary.hasType(biomeGenForCoords, BiomeDictionary.Type.END);
}
}
代码示例来源:origin: PenguinSquad/Harvest-Festival
@Override
@Nonnull
public List<Biome.SpawnListEntry> getPossibleCreatures(@Nonnull EnumCreatureType creatureType, @Nonnull BlockPos pos) {
if (creatureType == EnumCreatureType.MONSTER) {
return MONSTERS;
} else return this.world.getBiome(pos).getSpawnableList(creatureType);
}
代码示例来源:origin: ForestryMC/ForestryMC
@Override
public float getExactHumidity() {
BlockPos coords = getCoordinates();
return world.getBiome(coords).getRainfall();
}
代码示例来源:origin: ForestryMC/ForestryMC
@Override
public float getExactTemperature() {
BlockPos coords = getReferenceCoord();
return world.getBiome(coords).getTemperature(coords);
}
代码示例来源:origin: ForestryMC/ForestryMC
@Override
public EnumTemperature getTemperature() {
BlockPos coords = getReferenceCoord();
return EnumTemperature.getFromBiome(world.getBiome(coords), coords);
}
代码示例来源:origin: ForestryMC/ForestryMC
@Override
public float getExactHumidity() {
BlockPos coords = getReferenceCoord();
return world.getBiome(coords).getRainfall();
}
代码示例来源:origin: ForestryMC/ForestryMC
@Override
public float getExactTemperature() {
BlockPos coords = getCoordinates();
return world.getBiome(coords).getTemperature(coords);
}
代码示例来源:origin: MatterOverdrive/MatterOverdrive-Legacy-Edition
@Override
public boolean shouldGenerate(Random random, World world, BlockPos pos) {
return world.getBiome(pos) == Biome.REGISTRY.getObject(new ResourceLocation("minecraft", "desert"));
}
}
代码示例来源:origin: MCTCP/TerrainControl
@Override
public LocalBiome getSavedBiome(int x, int z) throws BiomeNotFoundException
{
return getBiomeById(Biome.getIdForBiome(this.world.getBiome(new BlockPos(x, 0, z))));
}
代码示例来源:origin: TeamLapen/Vampirism
/**
* Checks if light level is low enough
* Only exception is the vampire biome in which it returns true if ontop of {@link ModBlocks#cursed_earth}
*/
private boolean getCanSpawnHereRestricted() {
boolean vampireBiome = ModBiomes.vampireForest.equals(this.world.getBiome(this.getPosition()));
if (!vampireBiome) return isLowLightLevel();
IBlockState iblockstate = this.world.getBlockState((new BlockPos(this)).down());
return ModBlocks.cursed_earth.equals(iblockstate.getBlock());
}
}
代码示例来源:origin: McJtyMods/ModTutorials
@Override
public void populate(int x, int z) {
int i = x * 16;
int j = z * 16;
BlockPos blockpos = new BlockPos(i, 0, j);
Biome biome = this.worldObj.getBiome(blockpos.add(16, 0, 16));
// Add biome decorations (like flowers, grass, trees, ...)
biome.decorate(this.worldObj, this.random, blockpos);
// Make sure animals appropriate to the biome spawn here when the chunk is generated
WorldEntitySpawner.performWorldGenSpawning(this.worldObj, biome, i + 8, j + 8, 16, 16, this.random);
}
代码示例来源:origin: PenguinSquad/Harvest-Festival
public static boolean isRainingAt(World world, BlockPos pos) {
Biome biome = world.getBiome(pos);
Weather weather = HFApi.calendar.getWeather(world);
return (weather.isRain() || (weather.isSnow() && biome.isHighHumidity())) && world.canBlockSeeSky(pos) && world.getPrecipitationHeight(pos).getY() <= pos.getY() && world.getBiome(pos).canRain();
}
}
代码示例来源:origin: ForestryMC/Binnie
@Override
public boolean generate(final World world, final Random random, final BlockPos pos) {
final Biome biome = world.getBiome(pos);
if (!BiomeDictionary.hasType(biome, BiomeDictionary.Type.NETHER)) {
return false;
}
if (this.embedInWall(world, Blocks.NETHERRACK, pos)) {
world.setBlockState(pos, ModuleCore.hive.getDefaultState().withProperty(BlockExtraBeeHives.HIVE_TYPE, EnumHiveType.NETHER));
}
return true;
}
代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft
public static boolean isSwamp(World world, BlockPos pos)
{
ChunkDataTFC data = ChunkDataTFC.get(world, pos);
return data != null && data.isInitialized() &&
data.getRainfall() >= 375f &&
data.getFloraDiversity() >= 0.5f &&
data.getFloraDensity() >= 0.5f &&
world.getBiome(pos).getHeightVariation() < 0.15;
}
代码示例来源:origin: superckl/BiomeTweaker
@SubscribeEvent(priority = EventPriority.HIGH)
public void onBiomeDecorate(final DecorateBiomeEvent.Decorate e){
if(BiomeEventHandler.decorateTypes.isEmpty())
return;
final Biome gen = e.getWorld().getBiome(e.getChunkPos().getBlock(0, 0, 0));
if((BiomeEventHandler.decorateTypes.containsKey(Biome.getIdForBiome(gen))) && (BiomeEventHandler.decorateTypes.get(Biome.getIdForBiome(gen)).contains(e.getType().name()) || BiomeEventHandler.decorateTypes.get(Biome.getIdForBiome(gen)).contains("all")))
e.setResult(Result.DENY);
}
内容来源于网络,如有侵权,请联系作者删除!