当前位置: 首页>>代码示例>>Java>>正文


Java BiomeMap类代码示例

本文整理汇总了Java中org.dynmap.common.BiomeMap的典型用法代码示例。如果您正苦于以下问题:Java BiomeMap类的具体用法?Java BiomeMap怎么用?Java BiomeMap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


BiomeMap类属于org.dynmap.common包,在下文中一共展示了BiomeMap类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBiome

import org.dynmap.common.BiomeMap; //导入依赖的package包/类
@Override
public final BiomeMap getBiome()
{
    try
    {
        return biomemap[x - x_base][z - z_base];
    }
    catch (Exception ex)
    {
        return BiomeMap.NULL;
    }
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:13,代码来源:CanaryModMapChunkCache.java

示例2: getBiomeIDs

import org.dynmap.common.BiomeMap; //导入依赖的package包/类
@Override
public String[] getBiomeIDs() {
    BiomeMap[] b = BiomeMap.values();
    String[] bname = new String[b.length];
    for(int i = 0; i < bname.length; i++)
        bname[i] = b[i].toString();
    return bname;
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:9,代码来源:DynmapPlugin.java

示例3: loadExtraBiomes

import org.dynmap.common.BiomeMap; //导入依赖的package包/类
public void loadExtraBiomes(String mcver) {
    int cnt = 0;
    
    BiomeMap.loadWellKnownByVersion(mcver);
    /* Find array of biomes in biomebase */
    Biome[] biomelist = helper.getBiomeBaseList();
    /* Loop through list, skipping well known biomes */
    for(int i = 0; i < biomelist.length; i++) {
        Biome bb = biomelist[i];
        if(bb != null) {
            float tmp = bb.getTemperature();
            float hum = (float) ((double)bb.getRainfall() / 65536.0);
            BiomeMap bmap = BiomeMap.byBiomeID(i);
            if (bmap.isDefault()) {
                String id =  helper.getBiomeBaseIDString(bb);
                if(id == null) {
                    id = "BIOME_" + i;
                }
                BiomeMap m = new BiomeMap(i, id, tmp, hum);
                Log.verboseinfo("Add custom biome [" + m.toString() + "] (" + i + ")");
                cnt++;
            }
            else {
                bmap.setTemperature(tmp);
                bmap.setRainfall(hum);
            }
        }
    }
    if(cnt > 0) {
        Log.info("Added " + cnt + " custom biome mappings");
    }
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:33,代码来源:DynmapPlugin.java

示例4: getBiomeIDs

import org.dynmap.common.BiomeMap; //导入依赖的package包/类
@Override
public String[] getBiomeIDs() {
    BiomeMap[] b = BiomeMap.values();
    String[] bname = new String[b.length];
    for (int i = 0; i < bname.length; i++)
        bname[i] = b[i].toString();
    return bname;
}
 
开发者ID:UnoModding,项目名称:cynmap,代码行数:9,代码来源:CanaryServer.java

示例5: getBiome

import org.dynmap.common.BiomeMap; //导入依赖的package包/类
public BiomeMap getBiome() {
    Chunk chunk = world.getChunk(x >> 4, y >> 4);
    if (chunk != null) {
        return BiomeMap.byBiomeID(chunk.getBiome(x & 0xf, y & 0xf));
    } else {
        return BiomeMap.NULL;
    }
}
 
开发者ID:Captain-Chaos,项目名称:WorldPainter,代码行数:9,代码来源:WPMapIterator.java

示例6: biomePrep

import org.dynmap.common.BiomeMap; //导入依赖的package包/类
private void biomePrep()
{
    if (sameneighborbiomecnt != null)
    {
        return;
    }

    int x_size = x_dim << 4;
    int z_size = (z_max - z_min + 1) << 4;
    sameneighborbiomecnt = new byte[x_size][];
    biomemap = new BiomeMap[x_size][];

    for (int i = 0; i < x_size; i++)
    {
        sameneighborbiomecnt[i] = new byte[z_size];
        biomemap[i] = new BiomeMap[z_size];
    }

    for (int i = 0; i < x_size; i++)
    {
        for (int j = 0; j < z_size; j++)
        {
            if (j == 0)
                initialize(i + x_base, 64, z_base);
            else
                stepPosition(BlockStep.Z_PLUS);

            int bb = snap.getBiome(bx, bz);
            BiomeMap bm = BiomeMap.byBiomeID(bb);

            biomemap[i][j] = bm;
            int cnt = 0;

            if (i > 0)
            {
                if (bm == biomemap[i - 1][j])  /* Same as one to left */
                {
                    cnt++;
                    sameneighborbiomecnt[i - 1][j]++;
                }

                if ((j > 0) && (bm == biomemap[i - 1][j - 1]))
                {
                    cnt++;
                    sameneighborbiomecnt[i - 1][j - 1]++;
                }

                if ((j < (z_size - 1)) && (bm == biomemap[i - 1][j + 1]))
                {
                    cnt++;
                    sameneighborbiomecnt[i - 1][j + 1]++;
                }
            }

            if ((j > 0) && (biomemap[i][j] == biomemap[i][j - 1]))  /* Same as one to above */
            {
                cnt++;
                sameneighborbiomecnt[i][j - 1]++;
            }

            sameneighborbiomecnt[i][j] = (byte)cnt;
        }
    }
}
 
开发者ID:webbukkit,项目名称:DynmapCanary,代码行数:65,代码来源:CanaryModMapChunkCache.java

示例7: getBiome

import org.dynmap.common.BiomeMap; //导入依赖的package包/类
public BiomeMap getBiome() {
    return BiomeMap.NULL;
}
 
开发者ID:Captain-Chaos,项目名称:WorldPainter,代码行数:4,代码来源:WPObjectMapIterator.java


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