From 81dfe5ce52822455c843d3398c330fd915214d1e Mon Sep 17 00:00:00 2001 From: TexTrue <65154269+TexBlock@users.noreply.github.com> Date: Sat, 23 Nov 2024 15:29:12 +0800 Subject: [PATCH] 1.21.3 --- CHANGELOG.md | 2 +- .../background/DirtTexturedBackground.java | 37 ------------------- gradle.properties | 2 +- .../neoforge/ObsidianUINeoForge.java | 11 ++---- 4 files changed, 6 insertions(+), 46 deletions(-) delete mode 100644 common/src/main/java/org/thinkingstudio/obsidianui/background/DirtTexturedBackground.java diff --git a/CHANGELOG.md b/CHANGELOG.md index b17cac8..231d740 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,2 @@ ## Changelog -- update to 1.21.1 +- update to 1.21.3 diff --git a/common/src/main/java/org/thinkingstudio/obsidianui/background/DirtTexturedBackground.java b/common/src/main/java/org/thinkingstudio/obsidianui/background/DirtTexturedBackground.java deleted file mode 100644 index b849c72..0000000 --- a/common/src/main/java/org/thinkingstudio/obsidianui/background/DirtTexturedBackground.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright © 2020~2024 LambdAurora - * Copyright © 2024 ThinkingStudio - * - * This file is part of ObsidianUI. - * - * Licensed under the MIT license. For more information, - * see the LICENSE file. - */ - -package org.thinkingstudio.obsidianui.background; - -import net.minecraft.client.gui.DrawContext; -import org.thinkingstudio.obsidianui.util.RenderUtil; -import org.thinkingstudio.obsidianui.widget.SpruceWidget; - -@Deprecated(since = "1.20.5", forRemoval = true) -public record DirtTexturedBackground(int red, int green, int blue, int alpha) implements Background { - public static final Background NORMAL = new DirtTexturedBackground(64, 64, 64, 255); - public static final Background DARKENED = new DirtTexturedBackground(32, 32, 32, 255); - - @Override - public void render(DrawContext drawContext, SpruceWidget widget, int vOffset, int mouseX, int mouseY, float delta) { - RenderUtil.renderDirtBackgroundTexture(drawContext, widget.getX(), widget.getY(), widget.getWidth(), widget.getHeight(), - vOffset / 32.f, this.red, this.green, this.blue, this.alpha); - } - - @Override - public String toString() { - return "DirtTexturedBackground{" + - "red=" + this.red + - ", green=" + this.green + - ", blue=" + this.blue + - ", alpha=" + this.alpha + - '}'; - } -} diff --git a/gradle.properties b/gradle.properties index bccd099..a367a77 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ yarn_mappings=1.21.3+build.2 mappings_patch=1.21+build.4 archives_base_name=ObsidianUI -mod_version=0.2.9 +mod_version=0.2.10 maven_group=org.thinkingstudio.obsidianui fabric_loader_version=0.16.9 diff --git a/neoforge/src/main/java/org/thinkingstudio/obsidianui/neoforge/ObsidianUINeoForge.java b/neoforge/src/main/java/org/thinkingstudio/obsidianui/neoforge/ObsidianUINeoForge.java index 3b536c0..6b0dbba 100644 --- a/neoforge/src/main/java/org/thinkingstudio/obsidianui/neoforge/ObsidianUINeoForge.java +++ b/neoforge/src/main/java/org/thinkingstudio/obsidianui/neoforge/ObsidianUINeoForge.java @@ -13,7 +13,6 @@ import net.minecraft.client.MinecraftClient; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.EventPriority; -import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.common.Mod; import net.neoforged.fml.loading.FMLLoader; import net.neoforged.neoforge.client.event.ClientTickEvent; @@ -27,10 +26,8 @@ @Mod(value = ObsidianUI.MODID, dist = Dist.CLIENT) public class ObsidianUINeoForge { public ObsidianUINeoForge() { - IEventBus forgeEventBus = NeoForge.EVENT_BUS; - if (FMLLoader.getDist().isClient()) { - forgeEventBus.addListener(EventPriority.HIGHEST, RenderGuiEvent.Post.class, event -> { + NeoForge.EVENT_BUS.addListener(EventPriority.HIGHEST, RenderGuiEvent.Post.class, event -> { var drawContext = event.getGuiGraphics(); var tickDelta = event.getPartialTick(); @@ -39,7 +36,7 @@ public ObsidianUINeoForge() { hud.render(drawContext, tickDelta); }); }); - forgeEventBus.addListener(EventPriority.HIGHEST, ClientTickEvent.Post.class, event -> { + NeoForge.EVENT_BUS.addListener(EventPriority.HIGHEST, ClientTickEvent.Post.class, event -> { if (!HudManager.canRenderHuds(MinecraftClient.getInstance())) return; HudManager.HUDS.forEach((id, hud) -> { @@ -47,10 +44,10 @@ public ObsidianUINeoForge() { hud.tick(); }); }); - forgeEventBus.addListener(EventPriority.HIGHEST, OpenScreenCallbackEvent.Post.class, event -> { + NeoForge.EVENT_BUS.addListener(EventPriority.HIGHEST, OpenScreenCallbackEvent.Post.class, event -> { HudManager.initAll(event.getClient(), event.getClient().getWindow().getScaledWidth(), event.getClient().getWindow().getScaledHeight()); }); - forgeEventBus.addListener(EventPriority.HIGHEST, ResolutionChangeCallbackEvent.class, event -> { + NeoForge.EVENT_BUS.addListener(EventPriority.HIGHEST, ResolutionChangeCallbackEvent.class, event -> { HudManager.initAll(event.getClient(), event.getClient().getWindow().getScaledWidth(), event.getClient().getWindow().getScaledHeight()); }); }