Skip to content

Commit

Permalink
Add a workaround for disc sprite appearing shadowed
Browse files Browse the repository at this point in the history
  • Loading branch information
NotRyken committed Aug 8, 2024
1 parent fc40a66 commit 69f46df
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Fix a bug causing jukebox song to display incorrectly
- Add a workaround for disc sprite appearing shadowed
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ public NowPlayingToast(Component description, ItemStack itemStack) {
@Override
public @NotNull Visibility render(@NotNull GuiGraphics graphics, @NotNull ToastComponent toastComponent, long startTime) {
float scale = Config.get().options.toastScale;
graphics.pose().pushPose();
graphics.pose().translate(160 * (1 - scale), 0.0F, 0.0F);
graphics.pose().scale(scale, scale, 0.0F);
// TODO figure out why graphics pose() causes disc sprite to appear shadowed
if (scale != 1.0F) {
graphics.pose().pushPose();
graphics.pose().translate(160 * (1 - scale), 0.0F, 0.0F);
graphics.pose().scale(scale, scale, 0.0F);
}

Minecraft game = Minecraft.getInstance();

Expand Down Expand Up @@ -85,7 +88,7 @@ public NowPlayingToast(Component description, ItemStack itemStack) {
// Draw icon
graphics.renderFakeItem(itemStack, 9, (height / 2) - (16 / 2));

graphics.pose().popPose();
if (scale != 1.0F) graphics.pose().popPose();
return startTime - this.startTime >= this.displayTime ? Visibility.HIDE : Visibility.SHOW;
}

Expand Down

0 comments on commit 69f46df

Please sign in to comment.