本文整理汇总了Java中net.minecraftforge.fml.common.ProgressManager.ProgressBar类的典型用法代码示例。如果您正苦于以下问题:Java ProgressBar类的具体用法?Java ProgressBar怎么用?Java ProgressBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProgressBar类属于net.minecraftforge.fml.common.ProgressManager包,在下文中一共展示了ProgressBar类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: processRenderers
import net.minecraftforge.fml.common.ProgressManager.ProgressBar; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
private static void processRenderers() {
log.info("Start processing " + modelList.size() + " models");
ProgressBar bar = ProgressManager.push("Loading Renderers", modelList.size());
for (Entry<Item, Entry<ModelResourceLocation, Integer>> e : modelList) {
addRenderToRegistry(e.getKey(), e.getValue().getValue(), e.getValue().getKey(), bar);
}
log.info("Loaded " + modelList.size() + " models.");
modelList.clear();
ProgressManager.pop(bar);
}
开发者ID:tom5454,项目名称:Toms-Mod,代码行数:12,代码来源:CoreInit.java
示例5: 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
示例6: 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
示例7: 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
示例8: FMLProgressBar
import net.minecraftforge.fml.common.ProgressManager.ProgressBar; //导入依赖的package包/类
public FMLProgressBar(ProgressBar progressBar) {
this.progressBar = progressBar;
}
开发者ID:NOVA-Team,项目名称:NOVA-Core,代码行数:4,代码来源:FMLProgressBar.java
注:本文中的net.minecraftforge.fml.common.ProgressManager.ProgressBar类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论