Fix inconsistencies in how the values from the model are passed into the baked model.

This puts them in line with vanilla, as intended.
This commit is contained in:
David Quintana 2020-09-15 16:17:57 +02:00
parent 873c490470
commit 4b93e3a224
3 changed files with 6 additions and 3 deletions

View file

@ -5,7 +5,7 @@
private final ItemCameraTransforms field_177651_f; private final ItemCameraTransforms field_177651_f;
+ public Builder(net.minecraftforge.client.model.IModelConfiguration model, ItemOverrideList overrides) { + public Builder(net.minecraftforge.client.model.IModelConfiguration model, ItemOverrideList overrides) {
+ this(model.useSmoothLighting(), model.isShadedInGui(), model.isSideLit(), model.getCameraTransforms(), overrides); + this(model.useSmoothLighting(), model.isSideLit(), model.isShadedInGui(), model.getCameraTransforms(), overrides);
+ } + }
+ +
public Builder(BlockModel p_i230060_1_, ItemOverrideList p_i230060_2_, boolean p_i230060_3_) { public Builder(BlockModel p_i230060_1_, ItemOverrideList p_i230060_2_, boolean p_i230060_3_) {

View file

@ -214,7 +214,7 @@ public class CompositeModel implements IDynamicBakedModel
continue; continue;
bakedParts.put(part.getKey(), submodel.bakeModel(bakery, spriteGetter, modelTransform, modelLocation)); bakedParts.put(part.getKey(), submodel.bakeModel(bakery, spriteGetter, modelTransform, modelLocation));
} }
return new CompositeModel(owner.isShadedInGui(), owner.useSmoothLighting(), owner.isSideLit(), particle, bakedParts.build(), owner.getCombinedTransform(), overrides); return new CompositeModel(owner.isShadedInGui(), owner.isSideLit(), owner.useSmoothLighting(), particle, bakedParts.build(), owner.getCombinedTransform(), overrides);
} }
@Override @Override

View file

@ -58,7 +58,10 @@ public interface IModelConfiguration {
RenderMaterial resolveTexture(String name); RenderMaterial resolveTexture(String name);
/** /**
* @return True if the item uses 3D lighting. * @return True if the item is a 3D model, false if it's a generated item model.
* TODO: Rename.
* This value has nothing to do with shading anymore, and this name is misleading.
* It's actual purpose seems to be relegated to translating the model during rendering, so that it's centered.
*/ */
boolean isShadedInGui(); boolean isShadedInGui();