From 9c99b9edcf04952756c025bbb27bc5c48ecfb033 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Mon, 26 Jun 2023 21:09:54 +0700 Subject: [PATCH] make the relado config realoda core otr oto --- .../chipmunk/chipmunkmod/commands/ReloadConfigCommand.java | 2 ++ .../java/land/chipmunk/chipmunkmod/modules/CommandCore.java | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/land/chipmunk/chipmunkmod/commands/ReloadConfigCommand.java b/src/main/java/land/chipmunk/chipmunkmod/commands/ReloadConfigCommand.java index 8af6f2a..55d1486 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/commands/ReloadConfigCommand.java +++ b/src/main/java/land/chipmunk/chipmunkmod/commands/ReloadConfigCommand.java @@ -4,6 +4,7 @@ import com.mojang.brigadier.Command; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.context.CommandContext; import land.chipmunk.chipmunkmod.ChipmunkMod; +import land.chipmunk.chipmunkmod.modules.CommandCore; import land.chipmunk.chipmunkmod.modules.CustomChat; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; import net.minecraft.text.Text; @@ -27,6 +28,7 @@ public class ReloadConfigCommand { ChipmunkMod.CONFIG = ChipmunkMod.loadConfig(); CustomChat.INSTANCE.reloadFormat(); + CommandCore.INSTANCE.reloadRelativeArea(); source.sendFeedback(Text.literal("Successfully reloaded the config")); } catch (IOException e) { diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java index b8a2b20..e08dfc1 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java @@ -20,7 +20,7 @@ public class CommandCore { private final MinecraftClient client; @Getter @Setter private boolean ready = false; @Getter @Setter private BlockPos origin; - @Getter private final BlockArea relativeArea; + @Getter private BlockArea relativeArea; @Getter @Setter private BlockPos currentBlockRelative; public static CommandCore INSTANCE = new CommandCore(MinecraftClient.getInstance(), ChipmunkMod.CONFIG.core.relativeArea); @@ -30,6 +30,10 @@ public class CommandCore { this.relativeArea = relativeArea; } + public void reloadRelativeArea () { + relativeArea = ChipmunkMod.CONFIG.core.relativeArea; + } + public void move (Vec3d position) { if (!ready) { ready = true;