Skip to content

Commit

Permalink
Rename Config.java to CreeperHealingConfig.java
Browse files Browse the repository at this point in the history
  • Loading branch information
ArkoSammy12 committed Nov 29, 2023
1 parent 19b8378 commit 4fcba1e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/main/java/xd/arkosammy/CreeperHealing.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import net.minecraft.server.MinecraftServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import xd.arkosammy.configuration.Config;
import xd.arkosammy.configuration.CreeperHealingConfig;
import xd.arkosammy.explosions.ExplosionListCodec;
import xd.arkosammy.explosions.AffectedBlock;
import xd.arkosammy.handlers.ExplosionListHandler;
Expand All @@ -23,7 +23,7 @@ public class CreeperHealing implements ModInitializer {
@Override
public void onInitialize() {

Config.initializeConfig();
CreeperHealingConfig.initializeConfig();

ServerLifecycleEvents.SERVER_STARTING.register(server -> {
try {
Expand Down Expand Up @@ -57,7 +57,7 @@ private static void onServerStopping(MinecraftServer server) throws IOException
ExplosionListCodec explosionListCodec = new ExplosionListCodec(ExplosionListHandler.getExplosionEventList());
explosionListCodec.serializeExplosionEvents(server);
ExplosionListHandler.getExplosionEventList().clear();
Config.updateConfigFile();
CreeperHealingConfig.updateConfigFile();
}

public static boolean isExplosionHandlingUnlocked(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import xd.arkosammy.commands.categories.*;
import xd.arkosammy.configuration.Config;
import xd.arkosammy.configuration.CreeperHealingConfig;

import java.io.IOException;

Expand All @@ -24,7 +24,7 @@ public static void registerCommands(CommandDispatcher<ServerCommandSource> dispa
.requires(serverCommandSource -> serverCommandSource.hasPermissionLevel(4))
.build();

//Reload Config node
//Reload CreeperHealingConfig node
LiteralCommandNode<ServerCommandSource> reloadNode = CommandManager
.literal("reload_config")
.requires(serverCommandSource -> serverCommandSource.hasPermissionLevel(4))
Expand Down Expand Up @@ -53,7 +53,7 @@ public static void registerCommands(CommandDispatcher<ServerCommandSource> dispa

private static void reload(CommandContext<ServerCommandSource> ctx) throws IOException {
//If this returns true, then the config file exists, and we can update our values from it
if(Config.reloadConfigSettingsInMemory(ctx)) ctx.getSource().sendMessage(Text.literal("Config successfully reloaded"));
if(CreeperHealingConfig.reloadConfigSettingsInMemory(ctx)) ctx.getSource().sendMessage(Text.literal("CreeperHealingConfig successfully reloaded"));
else ctx.getSource().sendMessage(Text.literal("Found no existing config file to reload values from").formatted(Formatting.RED));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
import java.nio.file.Files;
import java.nio.file.Path;

public final class Config {
public final class CreeperHealingConfig {

private Config(){}
private CreeperHealingConfig(){}
private static final Path CONFIG_PATH = FabricLoader.getInstance().getConfigDir().resolve("creeper-healing.toml");
@Nullable
private static final GenericBuilder<CommentedConfig, CommentedFileConfig> CONFIG_BUILDER;
Expand Down

0 comments on commit 4fcba1e

Please sign in to comment.