MidnightLib 1.6.4 (Port to 1.21.2/3)

- Forgot to push this earlier, oops
This commit is contained in:
Martin Prokoph
2024-10-29 22:14:54 +01:00
parent 07e6049fa0
commit 18209609cb
4 changed files with 11 additions and 10 deletions

View File

@@ -37,7 +37,7 @@ public abstract class MixinOptionsScreen extends Screen {
}
}
@Inject(at = @At("TAIL"), method = "initTabNavigation")
@Inject(at = @At("TAIL"), method = "refreshWidgetPositions")
public void midnightlib$onResize(CallbackInfo ci) {
if (shouldShowButton()) this.midnightlib$setButtonPos();
}

View File

@@ -9,6 +9,7 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.Te
import net.minecraft.client.gui.Element; import net.minecraft.client.gui.Selectable; import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.tab.GridScreenTab; import net.minecraft.client.gui.tab.Tab; import net.minecraft.client.gui.tab.TabManager;
import net.minecraft.client.gui.tooltip.Tooltip; import net.minecraft.client.gui.widget.*;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.registry.Registries;
import net.minecraft.screen.ScreenTexts;
@@ -418,7 +419,7 @@ public abstract class MidnightConfig {
protected void drawHeaderAndFooterSeparators(DrawContext context) {
if (renderHeaderSeparator) super.drawHeaderAndFooterSeparators(context);
else { RenderSystem.enableBlend();
context.drawTexture(this.client.world == null ? Screen.FOOTER_SEPARATOR_TEXTURE : Screen.INWORLD_FOOTER_SEPARATOR_TEXTURE, this.getX(), this.getBottom(), 0.0F, 0.0F, this.getWidth(), 2, 32, 2);
context.drawTexture(RenderLayer::getGuiTextured, this.client.world == null ? Screen.FOOTER_SEPARATOR_TEXTURE : Screen.INWORLD_FOOTER_SEPARATOR_TEXTURE, this.getX(), this.getBottom(), 0.0F, 0.0F, this.getWidth(), 2, 32, 2);
RenderSystem.disableBlend(); }
}
public void addButton(List<ClickableWidget> buttons, Text text, EntryInfo info) { this.addEntry(new ButtonEntry(buttons, text, info)); }