Skip to content

Commit

Permalink
chore: pre-commit changes [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 18, 2024
1 parent 04f1941 commit e93ecd0
Showing 1 changed file with 33 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,26 +145,40 @@ public static String getArg(List<DataTag> tags, String arg) {
public static void importConfig(ConfigRepository configRepo) {
var config = new Config();
ConfigAccessor configOldAccessor = new ConfigAccessor(
AdvancedPortalsPlugin.getInstance(), "config.yml");
AdvancedPortalsPlugin.getInstance(), "config.yml");
var configOld = configOldAccessor.getConfig();

config.useOnlySpecialAxe = configOld.getBoolean("UseOnlyServerMadeAxe", config.useOnlySpecialAxe);
config.blockSpectatorMode = configOld.getBoolean("BlockSpectatorMode", config.blockSpectatorMode);
config.selectorMaterial = configOld.getString("AxeItemId", config.selectorMaterial);
config.portalProtection = configOld.getBoolean("PortalProtection", config.portalProtection);
config.portalProtectionRaduis = configOld.getInt("PortalProtectionArea", config.portalProtectionRaduis);
config.defaultTriggerBlock = configOld.getString("DefaultPortalTriggerBlock", config.defaultTriggerBlock);
config.useOnlySpecialAxe = configOld.getBoolean(
"UseOnlyServerMadeAxe", config.useOnlySpecialAxe);
config.blockSpectatorMode = configOld.getBoolean(
"BlockSpectatorMode", config.blockSpectatorMode);
config.selectorMaterial =
configOld.getString("AxeItemId", config.selectorMaterial);
config.portalProtection =
configOld.getBoolean("PortalProtection", config.portalProtection);
config.portalProtectionRaduis = configOld.getInt(
"PortalProtectionArea", config.portalProtectionRaduis);
config.defaultTriggerBlock = configOld.getString(
"DefaultPortalTriggerBlock", config.defaultTriggerBlock);
if (config.defaultTriggerBlock.equals("PORTAL")) {
config.defaultTriggerBlock = "NETHER_PORTAL";
}
config.stopWaterFlow = configOld.getBoolean("StopWaterFlow", config.stopWaterFlow);
config.joinCooldown = configOld.getInt("PortalCooldown", config.joinCooldown);
config.throwbackStrength = configOld.getDouble("ThrowbackAmount", config.throwbackStrength);
config.playFailSound = configOld.getBoolean("PlayFailSound", config.playFailSound);
config.warpMessageOnActionBar = configOld.getInt("WarpMessageDisplay", 2) == 2;
config.warpMessageInChat = configOld.getInt("WarpMessageDisplay", 2) == 1;
config.enableProxySupport = configOld.getBoolean("ForceEnableProxySupport", config.enableProxySupport);
config.disableGatewayBeam = configOld.getBoolean("DisableGatewayBeam", config.disableGatewayBeam);
config.stopWaterFlow =
configOld.getBoolean("StopWaterFlow", config.stopWaterFlow);
config.joinCooldown =
configOld.getInt("PortalCooldown", config.joinCooldown);
config.throwbackStrength =
configOld.getDouble("ThrowbackAmount", config.throwbackStrength);
config.playFailSound =
configOld.getBoolean("PlayFailSound", config.playFailSound);
config.warpMessageOnActionBar =
configOld.getInt("WarpMessageDisplay", 2) == 2;
config.warpMessageInChat =
configOld.getInt("WarpMessageDisplay", 2) == 1;
config.enableProxySupport = configOld.getBoolean(
"ForceEnableProxySupport", config.enableProxySupport);
config.disableGatewayBeam = configOld.getBoolean(
"DisableGatewayBeam", config.disableGatewayBeam);

CommandPortalConfig commandConfig = new CommandPortalConfig();
var commandString = configOld.getString("CommandLevels", "opcb");
Expand All @@ -177,8 +191,10 @@ public static void importConfig(ConfigRepository configRepo) {
config.commandPortals = commandConfig;

WarpEffectConfig warpEffectConfig = new WarpEffectConfig();
warpEffectConfig.visualEffect = configOld.getInt("WarpParticles", 1) == 1 ? "ender" : null;
warpEffectConfig.soundEffect = configOld.getInt("WarpSound", 1) == 1 ? "ender" : null;
warpEffectConfig.visualEffect =
configOld.getInt("WarpParticles", 1) == 1 ? "ender" : null;
warpEffectConfig.soundEffect =
configOld.getInt("WarpSound", 1) == 1 ? "ender" : null;
config.warpEffect = warpEffectConfig;

configRepo.importConfig(config);
Expand Down

0 comments on commit e93ecd0

Please sign in to comment.