mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-12 10:31:37 +01:00
Migrate old TNT height nerf settings to falling block height nerf
This commit is contained in:
parent
5866cac361
commit
7d15ab73ad
@ -78,3 +78,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
}
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
@ -58,3 +58,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
}
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
@ -47,3 +47,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
}
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
@ -39,6 +39,48 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ public int fallingBlockHeightNerf;
|
||||
+ private void fallingBlockheightNerf()
|
||||
+ {
|
||||
+ // TODO: Remove migrations after most users have upgraded.
|
||||
+ if ( PaperSpigotConfig.version < 8 )
|
||||
+ {
|
||||
+ // Migrate default value
|
||||
+
|
||||
+ int heightNerf = config.getInt( "world-settings.default.falling-block-height-nerf", 0 );
|
||||
+ if ( heightNerf == 0 ) heightNerf = config.getInt( "world-settings.default.tnt-entity-height-nerf", 0 );
|
||||
+ if ( heightNerf == 0 ) heightNerf = config.getInt( "world-settings.default.tnt-gameplay.tnt-entity-height-limit", 0 );
|
||||
+ if ( heightNerf != 0 ) config.set( "world-settings.default.falling-block-height-nerf", heightNerf );
|
||||
+
|
||||
+ if ( config.contains( "world-settings.default.tnt-entity-height-nerf" ) )
|
||||
+ {
|
||||
+ config.getDefaults().set( "world-settings.default.tnt-entity-height-nerf", null );
|
||||
+ config.set( "world-settings.default.tnt-entity-height-nerf", null );
|
||||
+ }
|
||||
+
|
||||
+ if ( config.contains( "world-settings.default.tnt-gameplay.tnt-entity-height-limit" ) )
|
||||
+ {
|
||||
+ config.getDefaults().set( "world-settings.default.tnt-gameplay.tnt-entity-height-limit", null );
|
||||
+ config.set( "world-settings.default.tnt-gameplay.tnt-entity-height-limit", null );
|
||||
+ }
|
||||
+
|
||||
+ // Migrate world setting
|
||||
+
|
||||
+ heightNerf = config.getInt( "world-settings." + worldName + ".falling-block-height-nerf" );
|
||||
+ if ( heightNerf == 0 ) heightNerf = config.getInt( "world-settings." + worldName + ".tnt-entity-height-nerf", 0 );
|
||||
+ if ( heightNerf == 0 ) heightNerf = config.getInt( "world-settings." + worldName + ".tnt-gameplay.tnt-entity-height-limit", 0 );
|
||||
+ if ( heightNerf != 0 ) config.set( "world-settings." + worldName + ".falling-block-height-nerf", heightNerf );
|
||||
+
|
||||
+ if ( config.contains( "world-settings." + worldName + ".tnt-entity-height-nerf" ) )
|
||||
+ {
|
||||
+ config.getDefaults().set( "world-settings." + worldName + ".tnt-entity-height-nerf", null );
|
||||
+ config.set( "world-settings." + worldName + ".tnt-entity-height-nerf", null);
|
||||
+ }
|
||||
+
|
||||
+ if ( config.contains( "world-settings." + worldName + ".tnt-gameplay.tnt-entity-height-limit" ) )
|
||||
+ {
|
||||
+ config.getDefaults().set( "world-settings." + worldName + ".tnt-gameplay.tnt-entity-height-limit", null );
|
||||
+ config.set( "world-settings." + worldName + ".tnt-gameplay.tnt-entity-height-limit", null );
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ fallingBlockHeightNerf = getInt( "falling-block-height-nerf", 0 );
|
||||
+ if ( fallingBlockHeightNerf != 0 )
|
||||
+ {
|
||||
@ -47,3 +89,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
}
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
@ -147,8 +147,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+ commands = new HashMap<String, Command>();
|
||||
+
|
||||
+ version = getInt( "config-version", 7 );
|
||||
+ set( "config-version", 7 );
|
||||
+ version = getInt( "config-version", 8 );
|
||||
+ set( "config-version", 8 );
|
||||
+ readConfig( PaperSpigotConfig.class, null );
|
||||
+ }
|
||||
+
|
||||
@ -317,3 +317,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
@ -116,3 +116,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
}
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
@ -37,3 +37,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
}
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user