aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/world/anhgelus/manhunt/Config.java8
-rw-r--r--src/main/java/world/anhgelus/manhunt/Manhunt.java4
2 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/world/anhgelus/manhunt/Config.java b/src/main/java/world/anhgelus/manhunt/Config.java
new file mode 100644
index 0000000..d669de2
--- /dev/null
+++ b/src/main/java/world/anhgelus/manhunt/Config.java
@@ -0,0 +1,8 @@
+package world.anhgelus.manhunt;
+
+import eu.midnightdust.lib.config.MidnightConfig;
+
+public class Config extends MidnightConfig {
+ @Entry(category = "timings") public static int secondsBeforeRelease = 30;
+ @Entry(category = "timings") public static int updateCompassEach = 15;
+}
diff --git a/src/main/java/world/anhgelus/manhunt/Manhunt.java b/src/main/java/world/anhgelus/manhunt/Manhunt.java
index 3ababfd..3ebc2ad 100644
--- a/src/main/java/world/anhgelus/manhunt/Manhunt.java
+++ b/src/main/java/world/anhgelus/manhunt/Manhunt.java
@@ -3,6 +3,7 @@ package world.anhgelus.manhunt;
import com.mojang.brigadier.Command;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
+import eu.midnightdust.lib.config.MidnightConfig;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.entity.event.v1.ServerPlayerEvents;
@@ -54,6 +55,7 @@ public class Manhunt implements ModInitializer {
@Override
public void onInitialize() {
LOGGER.info("Initializing Manhunt");
+ MidnightConfig.init(MOD_ID, Config.class);
final LiteralArgumentBuilder<ServerCommandSource> command = literal("manhunt");
@@ -215,7 +217,7 @@ public class Manhunt implements ModInitializer {
updateCompass(hunter, tracked);
}
}
- }, 30*1000, 15*1000);
+ }, Config.secondsBeforeRelease*1000L, Config.updateCompassEach*1000L);
}
private void updateCompass(ServerPlayerEntity player, ServerPlayerEntity tracked) {