Alternative models work once again
This commit is contained in:
parent
3e1d959a23
commit
87ef833d32
2 changed files with 20 additions and 1 deletions
|
@ -369,7 +369,7 @@ public class ModelLoader extends ModelBakery
|
||||||
Variant v = variants.get(i);
|
Variant v = variants.get(i);
|
||||||
builder.add(model.bake(addUV(v.isUvLocked(), state.apply(model)), format, bakedTextureGetter), variants.get(i).getWeight());
|
builder.add(model.bake(addUV(v.isUvLocked(), state.apply(model)), format, bakedTextureGetter), variants.get(i).getWeight());
|
||||||
}
|
}
|
||||||
return new IFlexibleBakedModel.Wrapper(builder.build(), Attributes.DEFAULT_BAKED_FORMAT);
|
return new FlexibleWeightedBakedModel(builder.build(), Attributes.DEFAULT_BAKED_FORMAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IModelState getDefaultState()
|
public IModelState getDefaultState()
|
||||||
|
@ -378,6 +378,24 @@ public class ModelLoader extends ModelBakery
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static class FlexibleWeightedBakedModel extends WeightedBakedModel implements IFlexibleBakedModel
|
||||||
|
{
|
||||||
|
private final WeightedBakedModel parent;
|
||||||
|
private final VertexFormat format;
|
||||||
|
|
||||||
|
public FlexibleWeightedBakedModel(WeightedBakedModel parent, VertexFormat format)
|
||||||
|
{
|
||||||
|
super(parent.models);
|
||||||
|
this.parent = parent;
|
||||||
|
this.format = format;
|
||||||
|
}
|
||||||
|
|
||||||
|
public VertexFormat getFormat()
|
||||||
|
{
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private boolean isBuiltinModel(ModelBlock model)
|
private boolean isBuiltinModel(ModelBlock model)
|
||||||
{
|
{
|
||||||
return model == MODEL_GENERATED || model == MODEL_COMPASS || model == MODEL_CLOCK || model == MODEL_ENTITY;
|
return model == MODEL_GENERATED || model == MODEL_COMPASS || model == MODEL_CLOCK || model == MODEL_ENTITY;
|
||||||
|
|
|
@ -148,3 +148,4 @@ protected net.minecraft.client.resources.model.ModelBakery func_177581_b(Lnet/mi
|
||||||
protected net.minecraft.client.resources.model.ModelBakery func_177587_c(Lnet/minecraft/client/renderer/block/model/ModelBlock;)Z # isCustomRenderer
|
protected net.minecraft.client.resources.model.ModelBakery func_177587_c(Lnet/minecraft/client/renderer/block/model/ModelBlock;)Z # isCustomRenderer
|
||||||
protected net.minecraft.client.resources.model.ModelBakery func_177582_d(Lnet/minecraft/client/renderer/block/model/ModelBlock;)Lnet/minecraft/client/renderer/block/model/ModelBlock; # makeItemModel
|
protected net.minecraft.client.resources.model.ModelBakery func_177582_d(Lnet/minecraft/client/renderer/block/model/ModelBlock;)Lnet/minecraft/client/renderer/block/model/ModelBlock; # makeItemModel
|
||||||
protected net.minecraft.client.resources.model.ModelBakery func_177580_d(Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/util/ResourceLocation; # getModelLocation
|
protected net.minecraft.client.resources.model.ModelBakery func_177580_d(Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/util/ResourceLocation; # getModelLocation
|
||||||
|
public net.minecraft.client.resources.model.WeightedBakedModel field_177565_b # models
|
||||||
|
|
Loading…
Reference in a new issue