diff --git a/build.gradle b/build.gradle index 6407170..454fc41 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.12-SNAPSHOT' + id 'fabric-loom' version '1.4-SNAPSHOT' id 'maven-publish' id 'io.github.juuxel.loom-quiltflower' version '1.7.1' } @@ -9,7 +9,7 @@ group = project.maven_group repositories { maven { url = "https://maven.terraformersmc.com/" } - maven { url = "https://ladysnake.jfrog.io/artifactory/mods" } + maven { url = "https://maven.ladysnake.org/releases" } maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } maven { url "https://maven.wispforest.io/" } } @@ -24,12 +24,15 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" modImplementation "dev.emi:trinkets:${project.trinkets_version}" + modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${project.cca_version}" + modImplementation "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${project.cca_version}" + modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}" modImplementation annotationProcessor ("io.wispforest:owo-lib:${project.owo_version}") include "io.wispforest:owo-sentinel:${project.owo_version}" - modCompileOnly 'me.lucko:fabric-permissions-api:0.1-SNAPSHOT' + modCompileOnly 'me.lucko:fabric-permissions-api:0.2-SNAPSHOT' } processResources { diff --git a/gradle.properties b/gradle.properties index 4f16885..5494ee7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,25 +2,26 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_base_version=1.20 -minecraft_version=1.20 -yarn_mappings=1.20+build.1 -loader_version=0.14.21 +minecraft_base_version=1.20.2 +minecraft_version=1.20.2 +yarn_mappings=1.20.2+build.2 +loader_version=0.14.22 # Mod Properties mod_version=0.3.2 maven_group=com.glisco archives_base_name=deathlog # Dependencies -fabric_version=0.83.0+1.20 +fabric_version=0.89.3+1.20.2 # https://github.com/emilyploszaj/trinkets/releases -# while we wait for an official release -# https://maven.wispforest.io/dev/emi/trinkets/ -trinkets_version=3.7.0-pre.3 +trinkets_version=3.8.0 + +# https://maven.ladysnake.org/#/releases/dev/onyxstudios/cardinal-components-api/cardinal-components-api/cardinal-components-base +cca_version=5.4.0 # https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu -modmenu_version=7.0.0-beta.2 +modmenu_version=8.0.0 # https://maven.wispforest.io/io/wispforest/owo-lib/ -owo_version=0.11.0+1.20 +owo_version=0.11.3+1.20.2 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ffed3a2..db9a6b8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/com/glisco/deathlog/client/gui/DeathLogScreen.java b/src/main/java/com/glisco/deathlog/client/gui/DeathLogScreen.java index 1f15024..50e99de 100644 --- a/src/main/java/com/glisco/deathlog/client/gui/DeathLogScreen.java +++ b/src/main/java/com/glisco/deathlog/client/gui/DeathLogScreen.java @@ -124,7 +124,8 @@ private void buildDeathList() { container.x() - root.padding().get().left() + mouseX, container.y() - root.padding().get().top() + mouseY, dropdown -> { - dropdown.surface(Surface.flat(0xBB000000).and(Surface.outline(0xA75F5F5F))); + dropdown.surface(Surface.blur(3, 5).and(Surface.flat(0xC7000000)).and(Surface.outline(0xFF121212))); + dropdown.zIndex(100); if (this.canRestore) { dropdown.button(Text.translatable("text.deathlog.action.restore"), dropdown_ -> { diff --git a/src/main/java/com/glisco/deathlog/mixin/ClientPlayNetworkHandlerMixin.java b/src/main/java/com/glisco/deathlog/mixin/ClientPlayNetworkHandlerMixin.java index 081315b..3d4efa3 100644 --- a/src/main/java/com/glisco/deathlog/mixin/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/com/glisco/deathlog/mixin/ClientPlayNetworkHandlerMixin.java @@ -4,37 +4,38 @@ import com.mojang.blaze3d.systems.RenderSystem; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.network.ClientCommonNetworkHandler; +import net.minecraft.client.network.ClientConnectionState; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.util.ScreenshotRecorder; +import net.minecraft.network.ClientConnection; import net.minecraft.network.packet.s2c.play.DeathMessageS2CPacket; import net.minecraft.network.packet.s2c.play.HealthUpdateS2CPacket; import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; -import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ClientPlayNetworkHandler.class) -public class ClientPlayNetworkHandlerMixin { +public abstract class ClientPlayNetworkHandlerMixin extends ClientCommonNetworkHandler { - @Shadow - @Final - private MinecraftClient client; + protected ClientPlayNetworkHandlerMixin(MinecraftClient client, ClientConnection connection, ClientConnectionState connectionState) { + super(client, connection, connectionState); + } @SuppressWarnings("ConstantConditions") @Inject(method = "onDeathMessage", at = @At("HEAD")) private void onClientDeath(DeathMessageS2CPacket packet, CallbackInfo ci) { if (!RenderSystem.isOnRenderThread()) return; - DeathLogClient.getClientStorage().store(packet.getMessage(), client.player); + DeathLogClient.getClientStorage().store(packet.getMessage(), this.client.player); if (DeathLogClient.CONFIG.screenshotsEnabled()) { - ScreenshotRecorder.saveScreenshot(FabricLoader.getInstance().getGameDir().toFile(), client.getFramebuffer(), text -> { + ScreenshotRecorder.saveScreenshot(FabricLoader.getInstance().getGameDir().toFile(), this.client.getFramebuffer(), text -> { text = Text.literal("§7[§bDeathLog§7] ").append(((MutableText) text).formatted(Formatting.GRAY)); - client.player.sendMessage(text, false); + this.client.player.sendMessage(text, false); }); } } @@ -42,14 +43,14 @@ private void onClientDeath(DeathMessageS2CPacket packet, CallbackInfo ci) { @Inject(method = "onHealthUpdate", at = @At("HEAD")) private void onLegacyClientDeath(HealthUpdateS2CPacket packet, CallbackInfo ci) { if (!DeathLogClient.CONFIG.useLegacyDeathDetection() || !RenderSystem.isOnRenderThread()) return; - if (packet.getHealth() > 0 || client.player.isDead()) return; + if (packet.getHealth() > 0 || this.client.player.isDead()) return; - DeathLogClient.getClientStorage().store(Text.empty(), client.player); + DeathLogClient.getClientStorage().store(Text.empty(), this.client.player); if (DeathLogClient.CONFIG.screenshotsEnabled()) { - ScreenshotRecorder.saveScreenshot(FabricLoader.getInstance().getGameDir().toFile(), client.getFramebuffer(), text -> { + ScreenshotRecorder.saveScreenshot(FabricLoader.getInstance().getGameDir().toFile(), this.client.getFramebuffer(), text -> { text = Text.literal("§7[§bDeathLog§7] ").append(((MutableText) text).formatted(Formatting.GRAY)); - client.player.sendMessage(text, false); + this.client.player.sendMessage(text, false); }); } }