Alternative models work once again

This commit is contained in:
RainWarrior committed 2015-02-14 00:23:03 +03:00
1 parent 3e1d959a23
commit 87ef833d32
2 files changed
+20 -1

No files matched your search

@@ -369,7 +369,7 @@ public class ModelLoader extends ModelBakery
Variant v = variants.get(i);
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()
@@ -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)
{
return model == MODEL_GENERATED || model == MODEL_COMPASS || model == MODEL_CLOCK || model == MODEL_ENTITY;