mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-07 16:12:02 +01:00
Migrate old TNT height nerf settings to falling block height nerf
This commit is contained in:
parent
5866cac361
commit
7d15ab73ad
@ -77,4 +77,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ boatsDropBoats = getBoolean( "game-mechanics.boats-drop-boats", false );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
@ -57,4 +57,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ log( "Water over lava flow speed: " + waterOverLavaFlowSpeed );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
@ -46,4 +46,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ netherVoidTopDamage = getBoolean( "nether-ceiling-void-damage", false );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
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 )
|
||||
+ {
|
||||
@ -46,4 +88,6 @@ 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 );
|
||||
+ }
|
||||
+
|
||||
@ -316,4 +316,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
@ -115,4 +115,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ removeUnloadedFallingBlocks = getBoolean( "remove-unloaded.falling-blocks", true );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
@ -36,4 +36,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ log( "Remove invalid mob spawner tile entities: " + removeInvalidMobSpawnerTEs );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.5.msysgit.1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user