aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/moe/nea/firmament
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-05-31 01:05:17 +0200
committernea <nea@nea.moe>2023-05-31 01:08:08 +0200
commitd670ed6bb054945d16a9d1ea2a32d469b524398a (patch)
tree96e50f42baf2cc21d4efb246f4d95105967b7553 /src/main/java/moe/nea/firmament
parenta24a74fa2351d53693226ba0d0018fb9589cddc9 (diff)
downloadFirmament-d670ed6bb054945d16a9d1ea2a32d469b524398a.tar.gz
Firmament-d670ed6bb054945d16a9d1ea2a32d469b524398a.tar.bz2
Firmament-d670ed6bb054945d16a9d1ea2a32d469b524398a.zip
Add option to auto rebuild resources before F3+T
Diffstat (limited to 'src/main/java/moe/nea/firmament')
-rw-r--r--src/main/java/moe/nea/firmament/mixins/devenv/MixinKeyboard.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/devenv/MixinKeyboard.java b/src/main/java/moe/nea/firmament/mixins/devenv/MixinKeyboard.java
new file mode 100644
index 0000000..b52af9b
--- /dev/null
+++ b/src/main/java/moe/nea/firmament/mixins/devenv/MixinKeyboard.java
@@ -0,0 +1,18 @@
+package moe.nea.firmament.mixins.devenv;
+
+import moe.nea.firmament.features.debug.DeveloperFeatures;
+import net.minecraft.client.Keyboard;
+import net.minecraft.client.MinecraftClient;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Redirect;
+
+import java.util.concurrent.CompletableFuture;
+
+@Mixin(Keyboard.class)
+public class MixinKeyboard {
+ @Redirect(method = "processF3", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;reloadResources()Ljava/util/concurrent/CompletableFuture;"))
+ public CompletableFuture<Void> redirectReloadResources(MinecraftClient instance) {
+ return DeveloperFeatures.hookOnBeforeResourceReload(instance);
+ }
+}