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


Java ProgressBar.step方法代码示例

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


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

示例1: onModelBake

import net.minecraftforge.fml.common.ProgressManager.ProgressBar; //导入方法依赖的package包/类
@SubscribeEvent (priority = EventPriority.HIGHEST)
public void onModelBake(ModelBakeEvent event) {

    IModel missingIModel = ModelLoaderRegistry.getMissingModel();
    IBakedModel missingModel = missingIModel.bake(missingIModel.getDefaultState(), DefaultVertexFormats.ITEM, TextureUtils.bakedTextureGetter);
    Map<IModel, IBakedModel> bakedModels = new HashMap<>();
    HashMultimap<IModel, ModelResourceLocation> models = HashMultimap.create();
    Multimaps.invertFrom(Multimaps.forMap(toBake), models);

    ProgressBar bar = ProgressManager.push("CCL ModelLoading: Baking", models.keySet().size());

    for (IModel model : models.keySet()) {
        bar.step(String.format("[%s]", Joiner.on(", ").join(models.get(model))));
        if (model == missingIModel) {
            bakedModels.put(model, missingModel);
            continue;
        }
        bakedModels.put(model, model.bake(model.getDefaultState(), DefaultVertexFormats.ITEM, TextureUtils.bakedTextureGetter));
    }
    ProgressManager.pop(bar);

    for (Entry<ModelResourceLocation, IModel> entry : toBake.entrySet()) {
        event.getModelRegistry().putObject(entry.getKey(), bakedModels.get(entry.getValue()));
    }

}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:27,代码来源:CCBlockStateLoader.java

示例2: processSetFiles

import net.minecraftforge.fml.common.ProgressManager.ProgressBar; //导入方法依赖的package包/类
public void processSetFiles() {
    if(setFiles.size() <= 0) return;

    // > Be fancy.
    ProgressBar setProgress = ProgressManager.push("Processing", setFiles.size());

    for(File config : setFiles) {
        setProgress.step(config.getName());
        LogHelper.info("Reading " + config.getPath());
        try {
            NashornConfigProcessor.getInstance().ReadConfigFile(config);
        } catch (Exception e) {
            LogHelper.error("Error processing file " + config.getPath() + ": " + e.getMessage());
        }
    }

    // > Stop being fancy
    ProgressManager.pop(setProgress);
}
 
开发者ID:legendblade,项目名称:CraftingHarmonics,代码行数:20,代码来源:ConfigManager.java

示例3: propogateStateMessage

import net.minecraftforge.fml.common.ProgressManager.ProgressBar; //导入方法依赖的package包/类
@Subscribe
public void propogateStateMessage(FMLEvent stateEvent)
{
    if (stateEvent instanceof FMLPreInitializationEvent)
    {
        modObjectList = buildModObjectList();
    }
    ProgressBar bar = ProgressManager.push(stateEvent.description(), activeModList.size(), true);
    for (ModContainer mc : activeModList)
    {
        bar.step(mc.getName());
        sendEventToModContainer(stateEvent, mc);
    }
    ProgressManager.pop(bar);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:LoadController.java

示例4: addRenderToRegistry

import net.minecraftforge.fml.common.ProgressManager.ProgressBar; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
private static void addRenderToRegistry(Item item, int meta, ModelResourceLocation loc, ProgressBar bar) {
	String toString = loc.toString() + ":" + meta;
	bar.step(toString);
	ModelLoader.setCustomModelResourceLocation(item, meta, loc);
	// Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, meta, loc);
}
 
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:8,代码来源:CoreInit.java

示例5: loadModSubsets

import net.minecraftforge.fml.common.ProgressManager.ProgressBar; //导入方法依赖的package包/类
private static void loadModSubsets() {
    ProgressBar bar = ProgressManager.push("Mod Subsets", ForgeRegistries.ITEMS.getKeys().size());
    HashMap<String, ItemStackSet> modSubsets = new HashMap<>();

    for (Item item : ForgeRegistries.ITEMS) {
        ResourceLocation ident = item.getRegistryName();
        bar.step(ident.toString());
        if (ident == null) {
            LogHelper.error("Failed to find identifier for: " + item);
            continue;
        }
        String modId = ident.getResourceDomain();
        ItemInfo.itemOwners.put(item, modId);
        ItemStackSet itemset = modSubsets.computeIfAbsent(modId, k -> new ItemStackSet());
        itemset.with(item);
    }
    ProgressManager.pop(bar);

    API.addSubset("Mod.Minecraft", modSubsets.remove("minecraft"));
    for (Entry<String, ItemStackSet> entry : modSubsets.entrySet()) {
        ModContainer mc = FMLCommonHandler.instance().findContainerFor(entry.getKey());
        if (mc == null) {
            LogHelper.error("Missing container for " + entry.getKey());
        } else {
            API.addSubset("Mod." + mc.getName(), entry.getValue());
        }
    }
}
 
开发者ID:TheCBProject,项目名称:NotEnoughItems,代码行数:29,代码来源:NEIInitialization.java

示例6: setupModelRegistry

import net.minecraftforge.fml.common.ProgressManager.ProgressBar; //导入方法依赖的package包/类
@Override
public IRegistry<ModelResourceLocation, IBakedModel> setupModelRegistry()
{
    isLoading = true;
    loadBlocks();
    loadVariantItemModels();
    missingModel = ModelLoaderRegistry.getMissingModel();
    stateModels.put(MODEL_MISSING, missingModel);

    final Set<ResourceLocation> textures = Sets.newHashSet(ModelLoaderRegistry.getTextures());
    textures.remove(TextureMap.LOCATION_MISSING_TEXTURE);
    textures.addAll(LOCATIONS_BUILTIN_TEXTURES);

    textureMap.loadSprites(resourceManager, new ITextureMapPopulator()
    {
        public void registerSprites(TextureMap map)
        {
            for(ResourceLocation t : textures)
            {
                map.registerSprite(t);
            }
        }
    });

    IBakedModel missingBaked = missingModel.bake(missingModel.getDefaultState(), DefaultVertexFormats.ITEM, DefaultTextureGetter.INSTANCE);
    Map<IModel, IBakedModel> bakedModels = Maps.newHashMap();
    HashMultimap<IModel, ModelResourceLocation> models = HashMultimap.create();
    Multimaps.invertFrom(Multimaps.forMap(stateModels), models);

    if (firstLoad)
    {
        firstLoad = false;
        for (ModelResourceLocation mrl : stateModels.keySet())
        {
            bakedRegistry.putObject(mrl, missingBaked);
        }
        return bakedRegistry;
    }

    ProgressBar bakeBar = ProgressManager.push("ModelLoader: baking", models.keySet().size());

    for(IModel model : models.keySet())
    {
        bakeBar.step("[" + Joiner.on(", ").join(models.get(model)) + "]");
        if(model == getMissingModel())
        {
            bakedModels.put(model, missingBaked);
        }
        else
        {
            bakedModels.put(model, model.bake(model.getDefaultState(), DefaultVertexFormats.ITEM, DefaultTextureGetter.INSTANCE));
        }
    }

    ProgressManager.pop(bakeBar);

    for (Entry<ModelResourceLocation, IModel> e : stateModels.entrySet())
    {
        bakedRegistry.putObject(e.getKey(), bakedModels.get(e.getValue()));
    }
    return bakedRegistry;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:63,代码来源:ModelLoader.java


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