Skip to content

Commit 79f0942

Browse files
cassianccHamaIndustries
authored andcommitted
fix: item providers not showing item names
1 parent b3681b4 commit 79f0942

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/dev/hephaestus/glowcase/client/render/block/entity/ItemProviderBlockEntityRenderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import net.minecraft.util.math.RotationAxis;
2727
import net.minecraft.util.math.Vec2f;
2828
import net.minecraft.util.math.Vec3d;
29+
import net.minecraft.util.math.ColorHelper;
2930
import org.apache.commons.lang3.time.DurationFormatUtils;
3031

3132
public record ItemProviderBlockEntityRenderer(BlockEntityRendererFactory.Context context) implements BlockEntityRenderer<ItemProviderBlockEntity> {
@@ -105,7 +106,7 @@ public void render(ItemProviderBlockEntity entity, float tickDelta, MatrixStack
105106

106107
ItemStack stack = entity.getStack();
107108
Text name = stack.isEmpty() ? Text.translatable("gui.glowcase.none") : (Text.literal("")).append(stack.getName()).formatted(stack.getRarity().getFormatting());
108-
int color = name.getStyle().getColor() == null ? 0xFFFFFF : name.getStyle().getColor().getRgb();
109+
int color = ColorHelper.fullAlpha(name.getStyle().getColor() == null ? 0xFFFFFF : name.getStyle().getColor().getRgb());
109110
matrices.push();
110111
matrices.translate(-context.getTextRenderer().getWidth(name) / 2F, -4, 0);
111112
context.getTextRenderer().draw(name, 0, 0, color, false, matrices.peek().getPositionMatrix(), vertexConsumers, TextRenderer.TextLayerType.NORMAL, 0, LightmapTextureManager.MAX_LIGHT_COORDINATE);

0 commit comments

Comments
 (0)