本文整理匯總了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);
}
示例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));
}
示例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());
}
示例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!");
}
示例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!");
}
示例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());
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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();
}
}
示例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;
}
}
示例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();
}
}
示例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);
}
示例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("|", ""));
}
示例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");
}