2015-06-04 12:57:23 +02:00
|
|
|
From 996541c984eb8ce498be51cbc5fec44fe62c897d Mon Sep 17 00:00:00 2001
|
2014-07-30 10:35:19 +02:00
|
|
|
From: Byteflux <byte@byteflux.net>
|
2015-03-08 02:16:09 +01:00
|
|
|
Date: Sat, 7 Mar 2015 22:03:47 -0600
|
2014-07-30 10:35:19 +02:00
|
|
|
Subject: [PATCH] Drop falling block entities that are above the specified
|
2014-11-28 02:17:45 +01:00
|
|
|
height
|
2014-07-30 10:35:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
2015-03-08 02:16:09 +01:00
|
|
|
index ce91553..ef93776 100644
|
2014-07-30 10:35:19 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
|
2014-11-28 02:17:45 +01:00
|
|
|
@@ -69,6 +69,17 @@ public class EntityFallingBlock extends Entity {
|
|
|
|
|
2014-07-30 10:35:19 +02:00
|
|
|
this.motY -= 0.03999999910593033D;
|
|
|
|
this.move(this.motX, this.motY, this.motZ);
|
|
|
|
+
|
|
|
|
+ // PaperSpigot start - Drop falling blocks above the specified height
|
2014-08-06 01:45:22 +02:00
|
|
|
+ if (this.world.paperSpigotConfig.fallingBlockHeightNerf != 0 && this.locY > this.world.paperSpigotConfig.fallingBlockHeightNerf) {
|
2014-07-30 10:35:19 +02:00
|
|
|
+ if (this.dropItem) {
|
2014-11-28 02:17:45 +01:00
|
|
|
+ this.a(new ItemStack(block, 1, block.getDropData(this.block)), 0.0F);
|
2014-07-30 10:35:19 +02:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ this.die();
|
|
|
|
+ }
|
|
|
|
+ // PaperSpigot end
|
|
|
|
+
|
|
|
|
this.motX *= 0.9800000190734863D;
|
|
|
|
this.motY *= 0.9800000190734863D;
|
|
|
|
this.motZ *= 0.9800000190734863D;
|
|
|
|
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
2015-06-04 12:57:23 +02:00
|
|
|
index 8d707f7..8cdd858 100644
|
2014-07-30 10:35:19 +02:00
|
|
|
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
|
|
|
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
2015-06-04 12:57:23 +02:00
|
|
|
@@ -146,4 +146,56 @@ public class PaperSpigotWorldConfig
|
2014-07-30 10:35:19 +02:00
|
|
|
keepSpawnInMemory = getBoolean( "keep-spawn-loaded", true );
|
|
|
|
log( "Keep spawn chunk loaded: " + keepSpawnInMemory );
|
|
|
|
}
|
|
|
|
+
|
2015-02-23 22:03:10 +01:00
|
|
|
+ public int fallingBlockHeightNerf;
|
2014-08-06 01:45:22 +02:00
|
|
|
+ private void fallingBlockheightNerf()
|
2014-07-30 10:35:19 +02:00
|
|
|
+ {
|
2015-06-04 12:57:23 +02:00
|
|
|
+ // 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 );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
2015-02-23 22:03:10 +01:00
|
|
|
+ fallingBlockHeightNerf = getInt( "falling-block-height-nerf", 0 );
|
2015-03-08 02:16:09 +01:00
|
|
|
+ if ( fallingBlockHeightNerf != 0 )
|
|
|
|
+ {
|
|
|
|
+ log( "Falling Block Height Limit set to Y: " + fallingBlockHeightNerf );
|
2014-08-06 01:45:22 +02:00
|
|
|
+ }
|
2014-07-30 10:35:19 +02:00
|
|
|
+ }
|
|
|
|
}
|
|
|
|
--
|
2015-06-04 12:57:23 +02:00
|
|
|
1.9.5.msysgit.1
|
2014-07-30 10:35:19 +02:00
|
|
|
|