TerraformersMC / ModMenu

A menu for, you guessed it, mods!
MIT License
476 stars 140 forks source link

Update mod to Minecraft snapshot 23w31a #649

Closed haykam821 closed 10 months ago

haykam821 commented 10 months ago

This pull request updates the mod to Minecraft snapshot 23w31a, which contains significant changes to how screens and sprites are rendered. This pull request should be merged into a new 1.20.2 branch.

Screens are affected by a small refactor, where the super.render call is placed first and the this.renderBackgroundTexture call is replaced by an override of the renderBackground method:

  @Override
  public void render(DrawContext DrawContext, int mouseX, int mouseY, float delta) {
-   this.renderBackgroundTexture(DrawContext);
+   super.render(DrawContext, mouseX, mouseY, delta);

    // Additional code

-   super.render(DrawContext, mouseX, mouseY, delta);
  }
+ 
+ @Override
+ public void renderBackground(DrawContext context, int mouseX, int mouseY, float delta) {
+   this.renderBackgroundTexture(context);
+ }

The most significant change in Minecraft snapshot 23w31a is that sprites are now part of an atlas. This pull request does not follow this change to preserve resource pack compatibility, though the change could still happen in the future.

Due to a vanilla bug, the mod list does not render shadow gradients properly above mod entries.

This mod version also works with Minecraft snapshots 23w32a and 23w33a if a newer Fabric API version than the bundled version is installed.