本文整理汇总了Java中net.minecraft.server.BiomeBase类的典型用法代码示例。如果您正苦于以下问题:Java BiomeBase类的具体用法?Java BiomeBase怎么用?Java BiomeBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BiomeBase类属于net.minecraft.server包,在下文中一共展示了BiomeBase类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTemperatures
import net.minecraft.server.BiomeBase; //导入依赖的package包/类
private static float[] getTemperatures(WorldChunkManager chunkmanager, int chunkX, int chunkZ) {
BiomeBase[] biomes = chunkmanager.getBiomes(null, chunkX, chunkZ, 16, 16);
float[] temps = new float[biomes.length];
for (int i = 0; i < biomes.length; i++) {
float temp = biomes[i].temperature; // Vanilla of olde: ((int) biomes[i].temperature * 65536.0F) / 65536.0F
if (temp > 1F) {
temp = 1F;
}
temps[i] = temp;
}
return temps;
}
示例2: biomeBaseToBiome
import net.minecraft.server.BiomeBase; //导入依赖的package包/类
public static Biome biomeBaseToBiome(BiomeBase base) {
if (base == null) {
return null;
}
return BIOME_MAPPING[base.id];
}
示例3: CraftChunkSnapshot
import net.minecraft.server.BiomeBase; //导入依赖的package包/类
CraftChunkSnapshot(int x, int z, String wname, long wtime, short[][] sectionBlockIDs, byte[][] sectionBlockData, byte[][] sectionSkyLights, byte[][] sectionEmitLights, boolean[] sectionEmpty, int[] hmap, BiomeBase[] biome, double[] biomeTemp, double[] biomeRain) {
this.x = x;
this.z = z;
this.worldname = wname;
this.captureFulltime = wtime;
this.blockids = sectionBlockIDs;
this.blockdata = sectionBlockData;
this.skylight = sectionSkyLights;
this.emitlight = sectionEmitLights;
this.empty = sectionEmpty;
this.hmap = hmap;
this.biome = biome;
this.biomeTemp = biomeTemp;
this.biomeRain = biomeRain;
}
示例4: getMobsFor
import net.minecraft.server.BiomeBase; //导入依赖的package包/类
public List<?> getMobsFor(EnumCreatureType type, int x, int y, int z) {
BiomeBase biomebase = world.getBiome(x, z);
return biomebase == null ? null : biomebase.getMobs(type);
}
示例5: biomeToBiomeBase
import net.minecraft.server.BiomeBase; //导入依赖的package包/类
public static BiomeBase biomeToBiomeBase(Biome bio) {
if (bio == null) {
return null;
}
return BIOMEBASE_MAPPING[bio.ordinal()];
}
示例6: getEmptyChunkSnapshot
import net.minecraft.server.BiomeBase; //导入依赖的package包/类
public static ChunkSnapshot getEmptyChunkSnapshot(int x, int z, CraftWorld world, boolean includeBiome, boolean includeBiomeTempRain) {
BiomeBase[] biome = null;
double[] biomeTemp = null;
double[] biomeRain = null;
if (includeBiome || includeBiomeTempRain) {
WorldChunkManager wcm = world.getHandle().getWorldChunkManager();
if (includeBiome) {
biome = new BiomeBase[256];
for (int i = 0; i < 256; i++) {
biome[i] = world.getHandle().getBiome((x << 4) + (i & 0xF), (z << 4) + (i >> 4));
}
}
if (includeBiomeTempRain) {
biomeTemp = new double[256];
biomeRain = new double[256];
float[] dat = getTemperatures(wcm, x << 4, z << 4);
for (int i = 0; i < 256; i++) {
biomeTemp[i] = dat[i];
}
dat = wcm.getWetness(null, x << 4, z << 4, 16, 16);
for (int i = 0; i < 256; i++) {
biomeRain[i] = dat[i];
}
}
}
/* Fill with empty data */
int hSection = world.getMaxHeight() >> 4;
short[][] blockIDs = new short[hSection][];
byte[][] skyLight = new byte[hSection][];
byte[][] emitLight = new byte[hSection][];
byte[][] blockData = new byte[hSection][];
boolean[] empty = new boolean[hSection];
for (int i = 0; i < hSection; i++) {
blockIDs[i] = emptyBlockIDs;
skyLight[i] = emptySkyLight;
emitLight[i] = emptyData;
blockData[i] = emptyData;
empty[i] = true;
}
return new CraftChunkSnapshot(x, z, world.getName(), world.getFullTime(), blockIDs, blockData, skyLight, emitLight, empty, new int[256], biome, biomeTemp, biomeRain);
}
示例7: getEmptyChunkSnapshot
import net.minecraft.server.BiomeBase; //导入依赖的package包/类
public static ChunkSnapshot getEmptyChunkSnapshot(int x, int z, CraftWorld world, boolean includeBiome, boolean includeBiomeTempRain) {
BiomeBase[] biome = null;
double[] biomeTemp = null;
double[] biomeRain = null;
if (includeBiome || includeBiomeTempRain) {
WorldChunkManager wcm = world.getHandle().getWorldChunkManager();
if (includeBiome) {
biome = new BiomeBase[256];
for (int i = 0; i < 256; i++) {
biome[i] = world.getHandle().getBiome((x << 4) + (i & 0xF), (z << 4) + (i >> 4));
}
}
if (includeBiomeTempRain) {
biomeTemp = new double[256];
biomeRain = new double[256];
float[] dat = wcm.getTemperatures(null, x << 4, z << 4, 16, 16);
for (int i = 0; i < 256; i++) {
biomeTemp[i] = dat[i];
}
dat = wcm.getWetness(null, x << 4, z << 4, 16, 16);
for (int i = 0; i < 256; i++) {
biomeRain[i] = dat[i];
}
}
}
/* Fill with empty data */
int hSection = world.getMaxHeight() >> 4;
short[][] blockIDs = new short[hSection][];
byte[][] skyLight = new byte[hSection][];
byte[][] emitLight = new byte[hSection][];
byte[][] blockData = new byte[hSection][];
boolean[] empty = new boolean[hSection];
for (int i = 0; i < hSection; i++) {
blockIDs[i] = emptyBlockIDs;
skyLight[i] = emptySkyLight;
emitLight[i] = emptyData;
blockData[i] = emptyData;
empty[i] = true;
}
return new CraftChunkSnapshot(x, z, world.getName(), world.getFullTime(), blockIDs, blockData, skyLight, emitLight, empty, new int[256], biome, biomeTemp, biomeRain);
}
示例8: testMinecraftToBukkit
import net.minecraft.server.BiomeBase; //导入依赖的package包/类
@Test
public void testMinecraftToBukkit() {
for (BiomeBase biome : BiomeBase.REGISTRY_ID) {
Assert.assertNotNull("No Bukkit mapping for " + biome, CraftBlock.biomeBaseToBiome(biome));
}
}