• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java BiomeBase类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:17,代码来源:CraftChunk.java


示例2: biomeBaseToBiome

import net.minecraft.server.BiomeBase; //导入依赖的package包/类
public static Biome biomeBaseToBiome(BiomeBase base) {
    if (base == null) {
        return null;
    }

    return BIOME_MAPPING[base.id];
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:8,代码来源:CraftBlock.java


示例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;
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:16,代码来源:CraftChunkSnapshot.java


示例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);
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:6,代码来源:CustomChunkGenerator.java


示例5: biomeToBiomeBase

import net.minecraft.server.BiomeBase; //导入依赖的package包/类
public static BiomeBase biomeToBiomeBase(Biome bio) {
    if (bio == null) {
        return null;
    }
    return BIOMEBASE_MAPPING[bio.ordinal()];
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:7,代码来源:CraftBlock.java


示例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);
}
 
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:51,代码来源:CraftChunk.java


示例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);
}
 
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:51,代码来源:CraftChunk.java


示例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));
    }
}
 
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:7,代码来源:BiomeTest.java



注:本文中的net.minecraft.server.BiomeBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ImportRulePluginType类代码示例发布时间:2022-05-23
下一篇:
Java EntityEnderCrystal类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap