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


Java DimensionManager.getStaticDimensionIDs方法代码示例

本文整理汇总了Java中net.minecraftforge.common.DimensionManager.getStaticDimensionIDs方法的典型用法代码示例。如果您正苦于以下问题:Java DimensionManager.getStaticDimensionIDs方法的具体用法?Java DimensionManager.getStaticDimensionIDs怎么用?Java DimensionManager.getStaticDimensionIDs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraftforge.common.DimensionManager的用法示例。


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

示例1: getWorld

import net.minecraftforge.common.DimensionManager; //导入方法依赖的package包/类
/**
 * Get world instance by dimension name or id, case insensitive
 * @param dimension Dimension name or id
 * @return World instance
 */
public static UWorld getWorld(String dimension) {
    for (int dim : DimensionManager.getStaticDimensionIDs()) {
        if (DimensionManager.getWorld(dim) == null) {
            DimensionManager.initDimension(dim);
        }
    }
    for (World world : DimensionManager.getWorlds()) {
        UWorld uWorld = new UWorld(world);
        if (uWorld.getDimensionName().equalsIgnoreCase(dimension) || String.valueOf(uWorld.getDimensionID()).equalsIgnoreCase(dimension)) {
            return uWorld;
        }
    }
    return null;
}
 
开发者ID:ternsip,项目名称:StructPro,代码行数:20,代码来源:UWorld.java

示例2: updateBonfires

import net.minecraftforge.common.DimensionManager; //导入方法依赖的package包/类
private void updateBonfires() {
    bonfires.clear();
    for (int dim : DimensionManager.getStaticDimensionIDs()) {
        Map<Integer, List<List<Bonfire>>> series = createSeries(dim);
        if (series != null)
            if (series.get(dim) != null)
                bonfires.put(dim, series.get(dim));
    }
}
 
开发者ID:Wehavecookies56,项目名称:Bonfires,代码行数:10,代码来源:GuiBonfire.java

示例3: getFormattedRegisteredDimensionsDump

import net.minecraftforge.common.DimensionManager; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public static List<String> getFormattedRegisteredDimensionsDump()
{
    DimensionDump dimensionDump = new DimensionDump(6);
    Integer[] ids = DimensionManager.getStaticDimensionIDs();

    for (int i = 0; i < ids.length; i++)
    {
        DimensionType type = DimensionManager.getProviderType(ids[i]);

        if (type == null)
        {
            continue;
        }

        String dimId = ids[i].toString();
        String typeId = String.valueOf(type.getId());
        String name = type.getName();
        String shouldLoadSpawn = String.valueOf(type.shouldLoadSpawn());
        String worldProviderClass;
        String currentlyLoaded = String.valueOf(DimensionManager.getWorld(ids[i]) != null);

        try
        {
            worldProviderClass = ((Class<? extends WorldProvider>) field_worldProvider.get(type)).getSimpleName();
        }
        catch (Exception e)
        {
            worldProviderClass = "ERROR";
        }

        dimensionDump.addData(dimId, typeId, name, shouldLoadSpawn, worldProviderClass, currentlyLoaded);
    }

    dimensionDump.addTitle("ID", "Type ID", "Name", "Load Spawn?", "WorldProvider class", "Loaded?");
    dimensionDump.setColumnAlignment(0, Alignment.RIGHT); // dim ID
    dimensionDump.setColumnAlignment(1, Alignment.RIGHT); // type ID
    dimensionDump.setColumnAlignment(3, Alignment.RIGHT); // shouldLoadSpawn
    dimensionDump.setColumnAlignment(5, Alignment.RIGHT); // currentlyLoaded
    dimensionDump.setUseColumnSeparator(true);

    return dimensionDump.getLines();
}
 
开发者ID:maruohon,项目名称:justenoughdimensions,代码行数:44,代码来源:DimensionDump.java


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