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;