當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。