Make alternative falling block ground detection configurable

Workaround for GH-336
This commit is contained in:
Zach Brown 2016-07-28 20:54:48 -05:00
parent dff26d883a
commit 7dcb9b67ea
No known key found for this signature in database
GPG key ID: CC9DA35FC5450B76
4 changed files with 42 additions and 28 deletions

View file

@ -1,4 +1,4 @@
From d11bdc71163cd991a87f8268bbf0a7f9ac06a9ff Mon Sep 17 00:00:00 2001
From 1dc4a1ddd3ac2e061a97fc046481082e8e9a9f07 Mon Sep 17 00:00:00 2001
From: Martin Panzer <postremus1996@googlemail.com>
Date: Fri, 3 Jun 2016 23:13:39 +0200
Subject: [PATCH] Fix FallingBlocks being stuck on fences
@ -10,6 +10,20 @@ resulted in them always thinking they would be on air.
We now first check, if if we are already on the ground.
if not, we check if the falling block is inside of the hitbox of the block at y - 1.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index cc5e299..3500b6c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -358,4 +358,9 @@ public class PaperWorldConfig {
log("Old Cannon Behaviors: This feature may not be working entirely properly at the moment");
}
}
+
+ public boolean altFallingBlockOnGround;
+ private void altFallingBlockOnGround() {
+ altFallingBlockOnGround = getBoolean("use-alternate-fallingblock-onGround-detection", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/BlockFalling.java b/src/main/java/net/minecraft/server/BlockFalling.java
index 8f22dab..d3a0d70 100644
--- a/src/main/java/net/minecraft/server/BlockFalling.java
@ -27,7 +41,7 @@ index 8f22dab..d3a0d70 100644
public void a_(World world, BlockPosition blockposition) {}
}
diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java
index 4fd4371..c4d90b0 100644
index 4fd4371..dcfdd31 100644
--- a/src/main/java/net/minecraft/server/EntityFallingBlock.java
+++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java
@@ -2,7 +2,9 @@ package net.minecraft.server;
@ -49,19 +63,21 @@ index 4fd4371..c4d90b0 100644
+ if (!isOnGround()) {
this.onGround = false;
- // return; // CraftBukkit
+ return; // Paper
+ if (this.world.paperConfig.altFallingBlockOnGround) return; // Paper
}
this.motX *= 0.699999988079071D;
@@ -158,6 +159,30 @@ public class EntityFallingBlock extends Entity {
@@ -158,6 +159,32 @@ public class EntityFallingBlock extends Entity {
}
}
+ // Paper start
+ private boolean isOnGround() {
+ BlockPosition where = new BlockPosition(this.locX, this.locY - 0.009999999776482582D, this.locZ);
+ boolean cannotMoveThrough = !BlockFalling.canMoveThrough(this.world.getType(where));
+ if (!this.world.paperConfig.altFallingBlockOnGround) return cannotMoveThrough;
+
+ if (!BlockFalling.canMoveThrough(this.world.getType(where))) {
+ if (cannotMoveThrough) {
+ return true;
+ }
+

View file

@ -1,4 +1,4 @@
From 0f33dcc2f6a2a72926f3554e1b1ccab73a0203fa Mon Sep 17 00:00:00 2001
From a23f74a3dfe8b30db36e7700bc380db109cbb060 Mon Sep 17 00:00:00 2001
From: Techcable <Techcable@outlook.com>
Date: Sat, 18 Jun 2016 01:01:37 -0500
Subject: [PATCH] Make entities look for hoppers
@ -78,12 +78,12 @@ index 0000000..aef7c2b
+ double getZ();
+}
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index cc5e299..b811775 100644
index 3500b6c..86fda1a 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -358,4 +358,9 @@ public class PaperWorldConfig {
log("Old Cannon Behaviors: This feature may not be working entirely properly at the moment");
}
@@ -363,4 +363,9 @@ public class PaperWorldConfig {
private void altFallingBlockOnGround() {
altFallingBlockOnGround = getBoolean("use-alternate-fallingblock-onGround-detection", false);
}
+
+ public boolean isHopperPushBased;
@ -132,7 +132,7 @@ index d6cc51b..5bbaa87 100644
this.b = i;
this.c = j;
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index e21769f..93f9eab 100644
index fbf114f..d26ffa7 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -77,6 +77,19 @@ public abstract class Entity implements ICommandListener {
@ -370,5 +370,5 @@ index a651961..1f5de89 100644
if (!list.isEmpty()) {
--
2.9.2.windows.1
2.9.0

View file

@ -1,4 +1,4 @@
From dfc2ef2e5fbd2e862167bcfe062a7f92d591ec3b Mon Sep 17 00:00:00 2001
From 30b54896e79fe497994706d5ddabd083b11201e6 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 18 Jun 2016 23:22:12 -0400
Subject: [PATCH] Delay Chunk Unloads based on Player Movement
@ -17,13 +17,14 @@ This allows servers with smaller worlds who do less long distance exploring to s
wasting cpu cycles on saving/unloading/reloading chunks repeatedly.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index b811775..60a7dec 100644
index 86fda1a..17b90a0 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -359,6 +359,15 @@ public class PaperWorldConfig {
@@ -368,4 +368,13 @@ public class PaperWorldConfig {
private void isHopperPushBased() {
isHopperPushBased = getBoolean("hopper.push-based", true);
}
}
+
+ public long delayChunkUnloadsBy;
+ private void delayChunkUnloadsBy() {
+ delayChunkUnloadsBy = PaperConfig.getSeconds(getString("delay-chunk-unloads-by", "0s"));
@ -32,12 +33,9 @@ index b811775..60a7dec 100644
+ delayChunkUnloadsBy *= 1000;
+ }
+ }
+
public boolean isHopperPushBased;
private void isHopperPushBased() {
isHopperPushBased = getBoolean("hopper.push-based", true);
}
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
index a1f7e83..30c3d6c 100644
index a9f6efa..6bad7eb 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -30,6 +30,7 @@ public class Chunk {

View file

@ -1,4 +1,4 @@
From a0d46c98b0317cfaea271d536f0fa0cf8dc79167 Mon Sep 17 00:00:00 2001
From 4fa65e457e2d2b791017ad4e013447b940fbd137 Mon Sep 17 00:00:00 2001
From: Jadon Fowler <jadonflower@gmail.com>
Date: Sat, 18 Jun 2016 23:13:59 -0700
Subject: [PATCH] Toggleable Elytra Wall Damage
@ -7,12 +7,12 @@ Instead of calculating the damage taken from hitting a wall, you can
disable it in the config.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 60a7dec..ef08901 100644
index 17b90a0..af776b3 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -372,4 +372,9 @@ public class PaperWorldConfig {
private void isHopperPushBased() {
isHopperPushBased = getBoolean("hopper.push-based", true);
@@ -377,4 +377,9 @@ public class PaperWorldConfig {
delayChunkUnloadsBy *= 1000;
}
}
+
+ public boolean elytraHitWallDamage = true;
@ -21,7 +21,7 @@ index 60a7dec..ef08901 100644
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 837bc25..7162a9e 100644
index c0c60a7..8c98a19 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1615,6 +1615,7 @@ public abstract class EntityLiving extends Entity {