mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 19:56:15 +00:00
refactor: remove bots.chomens.authKey from config (migration V2 !!!)
This commit is contained in:
parent
c5fbd67510
commit
aaf7a44d95
3 changed files with 25 additions and 4 deletions
|
|
@ -3,6 +3,7 @@ package land.chipmunk.chipmunkmod.config;
|
|||
import land.chipmunk.chipmunkmod.config.migration.AbstractMigrationManager;
|
||||
import land.chipmunk.chipmunkmod.config.migrations.MigrationV0;
|
||||
import land.chipmunk.chipmunkmod.config.migrations.MigrationV1;
|
||||
import land.chipmunk.chipmunkmod.config.migrations.MigrationV2;
|
||||
|
||||
public final class ChipmunkModMigrations extends AbstractMigrationManager {
|
||||
public ChipmunkModMigrations() {
|
||||
|
|
@ -10,5 +11,6 @@ public final class ChipmunkModMigrations extends AbstractMigrationManager {
|
|||
|
||||
this.register(new MigrationV0()); // unversioned -> v0
|
||||
this.register(new MigrationV1());
|
||||
this.register(new MigrationV2());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public class Configuration {
|
|||
public BotInfo hbot = new BotInfo("#", null);
|
||||
public BotInfo sbot = new BotInfo(":", null);
|
||||
public BotInfo chipmunk = new BotInfo("'", null);
|
||||
public ChomeNSBotInfo chomens = new ChomeNSBotInfo("*", null, null, null);
|
||||
public ChomeNSBotInfo chomens = new ChomeNSBotInfo("*", null, null);
|
||||
public BotInfo fnfboyfriend = new BotInfo("~", null);
|
||||
public BotInfo nbot = new BotInfo("?", null);
|
||||
public BotInfo kittycorp = new BotInfo("^", null);
|
||||
|
|
@ -41,16 +41,14 @@ public class Configuration {
|
|||
public static class ChomeNSBotInfo {
|
||||
public String prefix;
|
||||
public @Nullable String key;
|
||||
public @Nullable String authKey;
|
||||
public @Nullable String formatKey;
|
||||
|
||||
public ChomeNSBotInfo() {
|
||||
}
|
||||
|
||||
public ChomeNSBotInfo(String prefix, @Nullable String key, @Nullable String authKey, @Nullable String formatKey) {
|
||||
public ChomeNSBotInfo(String prefix, @Nullable String key, @Nullable String formatKey) {
|
||||
this.prefix = prefix;
|
||||
this.key = key;
|
||||
this.authKey = authKey;
|
||||
this.formatKey = formatKey;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package land.chipmunk.chipmunkmod.config.migrations;
|
||||
|
||||
import land.chipmunk.chipmunkmod.config.migration.ConfigMigration;
|
||||
import org.spongepowered.configurate.transformation.ConfigurationTransformation;
|
||||
import org.spongepowered.configurate.transformation.TransformAction;
|
||||
|
||||
import static org.spongepowered.configurate.NodePath.path;
|
||||
|
||||
public class MigrationV2 implements ConfigMigration {
|
||||
@Override
|
||||
public int version() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConfigurationTransformation create() {
|
||||
return ConfigurationTransformation.builder()
|
||||
.addAction(path("bots", "chomens", "authKey"), TransformAction.remove())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue