diff --git a/build.gradle b/build.gradle index c36444a7..d0c1cdcf 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.7-SNAPSHOT' + id 'fabric-loom' version '1.13-SNAPSHOT' id 'maven-publish' } @@ -50,6 +50,10 @@ dependencies { // check for latest versions at https://jitpack.io/#dev.tildejustin/state-output modCompileOnly "dev.tildejustin.state-output:state-output-common:v1.2.0" + + modCompileOnly ("com.github.DuncanRuns.Hermes:1.16.1:9ab2d9cc4e") { + transitive = false + } } processResources { diff --git a/gradle.properties b/gradle.properties index a3ac4a43..a8d413ca 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ org.gradle.parallel=true # check these on https://fabricmc.net/develop minecraft_version=1.16.1 yarn_mappings=1.16.1-build.24 -loader_version=0.16.10 +loader_version=0.18.2 # Mod Properties mod_version=1.6 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index dedd5d1e..bad7c246 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/jitpack.yml b/jitpack.yml index b6d1d5d8..485f75cc 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,5 +1,5 @@ jdk: - - openjdk17 + - openjdk21 before_install: - - sdk install java 17.0.1-open - - sdk use java 17.0.1-open + - sdk install java 21.0.2-open + - sdk use java 21.0.2-open diff --git a/src/main/java/me/contaria/seedqueue/SeedQueueEntry.java b/src/main/java/me/contaria/seedqueue/SeedQueueEntry.java index 055eafd4..dcba3d46 100644 --- a/src/main/java/me/contaria/seedqueue/SeedQueueEntry.java +++ b/src/main/java/me/contaria/seedqueue/SeedQueueEntry.java @@ -69,6 +69,7 @@ public SeedQueueEntry(MinecraftServer server, LevelStorage.Session session, Mine this.userCache = userCache; ((SQMinecraftServer) server).seedQueue$setEntry(this); + ModCompat.hermes$writeToWorldLog(getServer(), "seedqueue_create", System.currentTimeMillis()); } public MinecraftServer getServer() { @@ -318,6 +319,7 @@ public void setMaxWorldGenerationReached() { public boolean lock() { if (!this.locked) { this.locked = true; + ModCompat.hermes$writeToWorldLog(this.server, "seedqueue_lock", System.currentTimeMillis()); SeedQueue.ping(); return true; } @@ -369,6 +371,7 @@ public synchronized void discard() { } SeedQueue.LOGGER.info("Discarding \"{}\"...", this.session.getDirectoryName()); + ModCompat.hermes$writeToWorldLog(this.server, "seedqueue_discard", System.currentTimeMillis()); this.discarded = true; diff --git a/src/main/java/me/contaria/seedqueue/compat/HermesCompat.java b/src/main/java/me/contaria/seedqueue/compat/HermesCompat.java new file mode 100644 index 00000000..718a5453 --- /dev/null +++ b/src/main/java/me/contaria/seedqueue/compat/HermesCompat.java @@ -0,0 +1,10 @@ +package me.contaria.seedqueue.compat; + +import me.duncanruns.hermes.api.HermesModAPI; +import net.minecraft.server.MinecraftServer; + +public class HermesCompat { + public static void writeToWorldLog(MinecraftServer server, String type, long time) { + HermesModAPI.writeToWorldLog(HermesModAPI.getSavePath(server), type, time); + } +} diff --git a/src/main/java/me/contaria/seedqueue/compat/ModCompat.java b/src/main/java/me/contaria/seedqueue/compat/ModCompat.java index 67d6745e..14f9e155 100644 --- a/src/main/java/me/contaria/seedqueue/compat/ModCompat.java +++ b/src/main/java/me/contaria/seedqueue/compat/ModCompat.java @@ -14,6 +14,7 @@ public class ModCompat { public static final boolean HAS_STANDARDSETTINGS = FabricLoader.getInstance().isModLoaded("standardsettings"); public static final boolean HAS_WORLDPREVIEW = FabricLoader.getInstance().isModLoaded("worldpreview"); public static final boolean HAS_STATEOUTPUT = FabricLoader.getInstance().isModLoaded("state-output"); + public static final boolean HAS_HERMES = FabricLoader.getInstance().isModLoaded("hermes"); public static void fastReset$fastReset(MinecraftServer server) { if (HAS_FASTRESET) { @@ -86,4 +87,10 @@ public class ModCompat { SeedQueuePreviewFrameBuffer.clearFramebufferPool(); } } + + public static void hermes$writeToWorldLog(MinecraftServer server, String type, long time) { + if (HAS_HERMES) { + HermesCompat.writeToWorldLog(server, type, time); + } + } } diff --git a/src/main/java/me/contaria/seedqueue/mixin/client/render/LevelLoadingScreenMixin.java b/src/main/java/me/contaria/seedqueue/mixin/client/render/LevelLoadingScreenMixin.java deleted file mode 100644 index edb4265a..00000000 --- a/src/main/java/me/contaria/seedqueue/mixin/client/render/LevelLoadingScreenMixin.java +++ /dev/null @@ -1,71 +0,0 @@ -package me.contaria.seedqueue.mixin.client.render; - -import com.llamalad7.mixinextras.sugar.Share; -import com.llamalad7.mixinextras.sugar.ref.LocalIntRef; -import me.contaria.seedqueue.SeedQueue; -import net.minecraft.client.gui.WorldGenerationProgressTracker; -import net.minecraft.client.gui.screen.LevelLoadingScreen; -import net.minecraft.client.util.math.MatrixStack; -import org.spongepowered.asm.mixin.Dynamic; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.*; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import java.awt.*; - -@Mixin(value = LevelLoadingScreen.class, priority = 1500) -public abstract class LevelLoadingScreenMixin { - - @Unique - private static final int NO_MODIFIER = new Color(255, 255, 255, 255).getRGB(); - - @Unique - private static final int TRANSPARENT_MODIFIER = new Color(255, 255, 255, 150).getRGB(); - - @Inject( - method = "drawChunkMap", - at = @At("HEAD") - ) - private static void setColorModifier(MatrixStack matrixStack, WorldGenerationProgressTracker tracker, int i, int j, int k, int l, CallbackInfo ci, @Share("colorModifier") LocalIntRef colorModifier) { - if (!SeedQueue.isOnWall() && SeedQueue.hasEntryMatching(entry -> tracker == entry.getWorldGenerationProgressTracker())) { - colorModifier.set(TRANSPARENT_MODIFIER); - } else { - colorModifier.set(NO_MODIFIER); - } - } - - // This group is here for compatibility with sodium's MixinLevelLoadingScreen @Overwrite of drawChunkMap. - @Group(name = "transparent") - @ModifyArg( - method = "drawChunkMap", - at = @At( - value = "INVOKE", - target = "Lnet/minecraft/client/gui/screen/LevelLoadingScreen;fill(Lnet/minecraft/client/util/math/MatrixStack;IIIII)V" - ), - slice = @Slice( - from = @At( - value = "FIELD", - target = "Lnet/minecraft/client/gui/screen/LevelLoadingScreen;STATUS_TO_COLOR:Lit/unimi/dsi/fastutil/objects/Object2IntMap;" - ) - ), - index = 5 - ) - private static int transparentSeedQueueChunkMap(int color, @Share("colorModifier") LocalIntRef colorModifier) { - return color & colorModifier.get(); - } - - @Dynamic - @Group(name = "transparent") - @ModifyArg( - method = "drawChunkMap", - at = @At( - value = "INVOKE", - target = "Lnet/minecraft/client/gui/screen/LevelLoadingScreen;addRect(Lnet/minecraft/util/math/Matrix4f;Lme/jellysquid/mods/sodium/client/model/vertex/formats/screen_quad/BasicScreenQuadVertexSink;IIIII)V" - ), - index = 6 - ) - private static int transparentSeedQueueChunkMap_sodium(int color, @Share("colorModifier") LocalIntRef colorModifier) { - return color & colorModifier.get(); - } -} diff --git a/src/main/resources/seedqueue.mixins.json b/src/main/resources/seedqueue.mixins.json index 81c220b8..fbf4a64f 100644 --- a/src/main/resources/seedqueue.mixins.json +++ b/src/main/resources/seedqueue.mixins.json @@ -22,7 +22,6 @@ "client.debug.DebugHudMixin", "client.levellist.LevelStorageMixin", "client.profiling.WorldRendererMixin", - "client.render.LevelLoadingScreenMixin", "client.render.MinecraftClientMixin", "client.sounds.SoundManagerMixin", "client.sounds.SoundSystemMixin",