From 4b93e3a224ad0fea110fb747afd7800ee81fd8e9 Mon Sep 17 00:00:00 2001 From: David Quintana Date: Tue, 15 Sep 2020 16:17:57 +0200 Subject: [PATCH] Fix inconsistencies in how the values from the model are passed into the baked model. This puts them in line with vanilla, as intended. --- .../client/renderer/model/SimpleBakedModel.java.patch | 2 +- .../java/net/minecraftforge/client/model/CompositeModel.java | 2 +- .../net/minecraftforge/client/model/IModelConfiguration.java | 5 ++++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/patches/minecraft/net/minecraft/client/renderer/model/SimpleBakedModel.java.patch b/patches/minecraft/net/minecraft/client/renderer/model/SimpleBakedModel.java.patch index 685bb5182..0d30c0b0a 100644 --- a/patches/minecraft/net/minecraft/client/renderer/model/SimpleBakedModel.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/model/SimpleBakedModel.java.patch @@ -5,7 +5,7 @@ private final ItemCameraTransforms field_177651_f; + 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_) { diff --git a/src/main/java/net/minecraftforge/client/model/CompositeModel.java b/src/main/java/net/minecraftforge/client/model/CompositeModel.java index 61aa778ce..6b3bc18d2 100644 --- a/src/main/java/net/minecraftforge/client/model/CompositeModel.java +++ b/src/main/java/net/minecraftforge/client/model/CompositeModel.java @@ -214,7 +214,7 @@ public class CompositeModel implements IDynamicBakedModel continue; 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 diff --git a/src/main/java/net/minecraftforge/client/model/IModelConfiguration.java b/src/main/java/net/minecraftforge/client/model/IModelConfiguration.java index 5331ce714..6e37b6fe3 100644 --- a/src/main/java/net/minecraftforge/client/model/IModelConfiguration.java +++ b/src/main/java/net/minecraftforge/client/model/IModelConfiguration.java @@ -58,7 +58,10 @@ public interface IModelConfiguration { 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();