From 5bd6110d59d3f0302fbd9e4c515e2d399aa528ec Mon Sep 17 00:00:00 2001 From: Snownee <1850986885@qq.com> Date: Wed, 11 Nov 2020 01:17:06 +0800 Subject: [PATCH] Implement GuiBlockModelRenderBuilder tinting --- .../com/simibubi/create/foundation/gui/GuiGameElement.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/gui/GuiGameElement.java b/src/main/java/com/simibubi/create/foundation/gui/GuiGameElement.java index 8b856cf94..34a0d6eb2 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/GuiGameElement.java +++ b/src/main/java/com/simibubi/create/foundation/gui/GuiGameElement.java @@ -32,7 +32,6 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IItemProvider; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; -import net.minecraftforge.client.model.data.EmptyModelData; import net.minecraftforge.fluids.FluidStack; public class GuiGameElement { @@ -173,7 +172,8 @@ public class GuiGameElement { protected void renderModel(BlockRendererDispatcher blockRenderer, IRenderTypeBuffer.Impl buffer, RenderType renderType, IVertexBuilder vb, MatrixStack ms) { - Vec3d rgb = ColorHelper.getRGB(color); + int color = Minecraft.getInstance().getBlockColors().getColor(blockState, null, null, 0); + Vec3d rgb = ColorHelper.getRGB(color == -1 ? this.color : color); blockRenderer.getBlockModelRenderer() .renderModel(ms.peek(), vb, blockState, blockmodel, (float) rgb.x, (float) rgb.y, (float) rgb.z, 0xF000F0, OverlayTexture.DEFAULT_UV, VirtualEmptyModelData.INSTANCE);