當前位置: 首頁>>代碼示例>>Java>>正文


Java ModelLoaderRegistry.getModelOrLogError方法代碼示例

本文整理匯總了Java中net.minecraftforge.client.model.ModelLoaderRegistry.getModelOrLogError方法的典型用法代碼示例。如果您正苦於以下問題:Java ModelLoaderRegistry.getModelOrLogError方法的具體用法?Java ModelLoaderRegistry.getModelOrLogError怎麽用?Java ModelLoaderRegistry.getModelOrLogError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在net.minecraftforge.client.model.ModelLoaderRegistry的用法示例。


在下文中一共展示了ModelLoaderRegistry.getModelOrLogError方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: process

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
@Override
public IModel process(IModel base) {
    boolean hasBase = base != ModelLoaderRegistry.getMissingModel();
    if (hasBase) {
        base = baseVariant.process(base);
    }

    List<IModel> subModels = new LinkedList<>();
    for (Variant variant : finalVariants) {
        if (!variant.getModelLocation().equals(new ResourceLocation("builtin/missing"))) {
            IModel subModel = ModelLoaderRegistry.getModelOrLogError(variant.getModelLocation(), "Unable to load subModel's Model: " + variant.getModelLocation());
            subModels.add(variant.process(new StateOverrideIModel(subModel, variant.getState())));
        }
    }

    return new CCMultiModel(hasBase ? base : null, baseProperties, subModels);
}
 
開發者ID:TheCBProject,項目名稱:CodeChickenLib,代碼行數:18,代碼來源:CCFinalMultiVariant.java

示例2: bake

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
	final Map<ResourceLocation, IBakedModel> bakedSubModels = Maps.newHashMap();

	for (ResourceLocation subModel : modelData.getAllModels()) {
		IModel model = ModelLoaderRegistry.getModelOrLogError(subModel, "Couldn't load sub-model dependency: " + subModel);
		bakedSubModels.put(subModel, model.bake(new ModelStateComposition(state, model.getDefaultState()), format, bakedTextureGetter));
	}

	final IModel baseModel;
	if (base.isPresent()) {
		ResourceLocation baseLocation = base.get();
		baseModel = ModelLoaderRegistry.getModelOrLogError(baseLocation, "Couldn't load base-model dependency: " + baseLocation);
	} else {
		baseModel = ModelLoaderRegistry.getMissingModel();
	}

	final IBakedModel bakedBaseModel = baseModel.bake(new ModelStateComposition(state, baseModel.getDefaultState()), format, bakedTextureGetter);

	return new BakedModel(bakedBaseModel, modelData, bakedSubModels, PerspectiveMapWrapper.getTransforms(state));
}
 
開發者ID:OpenMods,項目名稱:OpenModsLib,代碼行數:22,代碼來源:VariantModel.java

示例3: bake

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {

    Map<BlockRenderLayer, IBakedModel> layerModelMap = new HashMap<>();
    TextureAtlasSprite particle = TextureUtils.getMissingSprite();
    for (Entry<BlockRenderLayer, Map<EnumFacing, String>> layerEntry : layerFaceSpriteMap.entrySet()) {
        Map<String, String> kvTextures = new HashMap<>();
        for (Entry<EnumFacing, String> faceEntry : layerEntry.getValue().entrySet()) {
            if (faceEntry.getKey() == null) {
                kvTextures.put("particle", faceEntry.getValue());
            } else {
                kvTextures.put(faceEntry.getKey().getName(), faceEntry.getValue());
            }
        }
        IModel vanillaModel = ModelLoaderRegistry.getModelOrLogError(new ResourceLocation("minecraft:block/cube"), "Unable to get vanilla model wrapper..");
        vanillaModel = vanillaModel.retexture(ImmutableMap.copyOf(addMissing(kvTextures)));
        IBakedModel model = vanillaModel.bake(state, format, bakedTextureGetter);

        if (layerEntry.getKey() == BlockRenderLayer.SOLID) {
            particle = model.getParticleTexture();
        }

        layerModelMap.put(layerEntry.getKey(), model);
    }

    ModelProperties.Builder builder = ModelProperties.builder();
    builder.withAO(isAO).withGui3D(gui3d);
    builder.withParticle(particle);

    return new PerspectiveAwareLayeredModelWrapper(layerModelMap, builder.withState(state).build());
}
 
開發者ID:TheCBProject,項目名稱:CodeChickenLib,代碼行數:32,代碼來源:CCModelCube.java

示例4: model

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
/** @return A model whose location begins with "jjmod:block/beam/". */
protected static IModel model(String beam) {
    
    return ModelLoaderRegistry.getModelOrLogError(new ResourceLocation(
            Geomastery.MODID, "block/beam/" + beam),
            "Error loading model for delayed multipart thick beam!");
}
 
開發者ID:JayAvery,項目名稱:geomastery,代碼行數:8,代碼來源:RenderBeamThick.java

示例5: model

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
/** @return A model whose location begins with "jjmod:block/beam/". */
protected static IModel model(String beam) {
    
    return ModelLoaderRegistry.getModelOrLogError(new ResourceLocation(
            Geomastery.MODID, "block/beam/" + beam),
            "Error loading model for delayed multipart thin beam!");
}
 
開發者ID:JayAvery,項目名稱:geomastery,代碼行數:8,代碼來源:RenderBeamThin.java

示例6: atModelsBaked

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
@SubscribeEvent
public static void atModelsBaked(ModelBakeEvent bakeEvent) {
	IRegistry<ModelResourceLocation, IBakedModel> modelRegistry = bakeEvent.getModelRegistry();
	Map<ModelResourceLocation, IBakedModel> dependencies = new HashMap<>();
	for (IBakedModel model : modelRegistry) {
		if (!(model instanceof BakedModelWrapper)) {
			continue;
		}

		BakedModelWrapper bakedModel = (BakedModelWrapper) model;
		Set<ResourceLocation> overrideLocations = getDependencies(bakedModel);
		for (ResourceLocation dep : overrideLocations) {
			ModelResourceLocation actualDep = net.minecraftforge.client.model.ModelLoader
					.getInventoryVariant(dep.toString());
			if (modelRegistry.getKeys().contains(actualDep)) {
				continue;
			}

			IModel depModel = ModelLoaderRegistry.getModelOrLogError(dep, "Missing dependency model");
			IBakedModel depBakedModel = depModel.bake(
					depModel.getDefaultState(),
					DefaultVertexFormats.ITEM,
					EventListener::getTextureAtlas);
			dependencies.put(actualDep, depBakedModel);
		}
	}

	for (Entry<ModelResourceLocation, IBakedModel> entry : dependencies.entrySet()) {
		modelRegistry.putObject(entry.getKey(), entry.getValue());
	}
}
 
開發者ID:WorldSEnder,項目名稱:MCAnm,代碼行數:32,代碼來源:ModelLoader.java

示例7: getModel

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
private static IModel getModel(Optional<ResourceLocation> location) {
	if (location.isPresent()) {
		return ModelLoaderRegistry.getModelOrLogError(location.get(), "Couldn't load dependency: " + location.get());
	} else {
		return ModelLoaderRegistry.getMissingModel();
	}
}
 
開發者ID:OpenMods,項目名稱:OpenBlocks,代碼行數:8,代碼來源:DevNullModel.java

示例8: extractInventoryTransforms

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
private Map<TransformType, Matrix4f> extractInventoryTransforms(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
	if (inventoryTransformProvider.isPresent()) {
		final IModel model = ModelLoaderRegistry.getModelOrLogError(inventoryTransformProvider.get(), "Couldn't load MultiLayerModel dependency: " + inventoryTransformProvider.get());
		final IBakedModel bakedModel = model.bake(model.getDefaultState(), format, bakedTextureGetter);
		return extractInventoryTransformsFromModel(bakedModel);
	}
	// fallback: get transforms from our own model
	return extractInventoryTransformsFromState(state);
}
 
開發者ID:OpenMods,項目名稱:OpenBlocks,代碼行數:10,代碼來源:PathModel.java

示例9: bake

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
	final ImmutableMap<TransformType, TRSRTransformation> transforms = PerspectiveMapWrapper.getTransforms(state);

	final IModel base;
	if (baseModel.isPresent()) {
		base = ModelLoaderRegistry.getModelOrLogError(baseModel.get(), "Couldn't load canvas base: " + baseModel.get());
	} else {
		base = ModelLoaderRegistry.getMissingModel();
	}

	final IBakedModel bakedBaseModel = base.bake(state, format, bakedTextureGetter);

	return new BakedModelCanvas(bakedBaseModel, baseModelRenderLayers, transforms, bakedTextureGetter, format);
}
 
開發者ID:OpenMods,項目名稱:OpenBlocks,代碼行數:16,代碼來源:ModelCanvas.java

示例10: loadBaseModel

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
protected IModel loadBaseModel(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
	if (baseModel.isPresent()) {
		return ModelLoaderRegistry.getModelOrLogError(baseModel.get(), "Couldn't load eval model dependency: " + baseModel.get());
	} else {
		return ModelLoaderRegistry.getMissingModel();
	}
}
 
開發者ID:OpenMods,項目名稱:OpenModsLib,代碼行數:8,代碼來源:EvalModelBase.java

示例11: getOverrideModel

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
private IModel getOverrideModel(Optional<ResourceLocation> overrideLocation) {
	if (overrideLocation.isPresent()) {
		final ResourceLocation location = overrideLocation.get();
		return ModelLoaderRegistry.getModelOrLogError(location, "Couldn't load model: " + location);
	} else {
		return texturedModel;
	}
}
 
開發者ID:OpenMods,項目名稱:OpenModsLib,代碼行數:9,代碼來源:TexturedItemOverrides.java

示例12: getModel

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
private static IModel getModel(Optional<ResourceLocation> model) {
	if (model.isPresent()) {
		ResourceLocation location = model.get();
		return ModelLoaderRegistry.getModelOrLogError(location, "Couldn't load base-model dependency: " + location);
	} else {
		return ModelLoaderRegistry.getMissingModel();
	}
}
 
開發者ID:OpenMods,項目名稱:OpenModsLib,代碼行數:9,代碼來源:TexturedItemModel.java

示例13: bake

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
@Override
public IBakedModel bake(IModelState state, VertexFormat format, Function<ResourceLocation, TextureAtlasSprite> bakedTextureGetter) {
	final IModel model;
	if (base.isPresent()) {
		model = ModelLoaderRegistry.getModelOrLogError(base.get(), "Couldn't load MultiLayerModel dependency: " + base.get());
	} else {
		model = ModelLoaderRegistry.getMissingModel();
	}

	return model.bake(state, format, bakedTextureGetter);
}
 
開發者ID:OpenMods,項目名稱:OpenModsLib,代碼行數:12,代碼來源:ModelWithDependencies.java

示例14: getModel

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
private IModel getModel(ResourceLocation loc) {
	return ModelLoaderRegistry.getModelOrLogError(loc, "Couldn't load " + loc.toString() + " for " + item.delegate.name().toString().replaceAll("|", ""));
}
 
開發者ID:tom5454,項目名稱:Toms-Mod,代碼行數:4,代碼來源:ModelledItemModel.java

示例15: getModel

import net.minecraftforge.client.model.ModelLoaderRegistry; //導入方法依賴的package包/類
private static IModel getModel(ResourceLocation loc) {
	return ModelLoaderRegistry.getModelOrLogError(loc, "Couldn't load " + loc.toString() + " for hidden block renderer");
}
 
開發者ID:tom5454,項目名稱:Toms-Mod,代碼行數:4,代碼來源:ModelHidden.java


注:本文中的net.minecraftforge.client.model.ModelLoaderRegistry.getModelOrLogError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。