aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorZach Brown <[email protected]>2019-06-02 21:44:15 -0500
committerZach Brown <[email protected]>2019-06-02 21:44:15 -0500
commitf59f630b7bc58c6b8ef6f4e32642c5cdc8586a5e (patch)
tree41945730688012c91845b23d9adf9b46f9c0f270
parent8f7f4cfb3c4ec4d7dbeb502b1f66977115ffe5c6 (diff)
downloadPaper-f59f630b7bc58c6b8ef6f4e32642c5cdc8586a5e.tar.gz
Paper-f59f630b7bc58c6b8ef6f4e32642c5cdc8586a5e.zip
Backport some fixes from newer versions
MC-114618 EntityAreaEffectCloud negative size fix Option to prevent players from moving into unloaded chunks Fixes GH-2114
-rw-r--r--Spigot-Server-Patches/0383-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch43
-rw-r--r--Spigot-Server-Patches/0384-Add-option-to-prevent-players-from-moving-into-unloa.patch69
2 files changed, 112 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0383-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch b/Spigot-Server-Patches/0383-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch
new file mode 100644
index 0000000000..affb67bc23
--- /dev/null
+++ b/Spigot-Server-Patches/0383-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch
@@ -0,0 +1,43 @@
+From 14567b0450b943b00f8a36375b813f5efd73f4d8 Mon Sep 17 00:00:00 2001
+From: William Blake Galbreath <[email protected]>
+Date: Sun, 2 Jun 2019 21:12:42 -0500
+Subject: [PATCH] MC-114618 - Fix EntityAreaEffectCloud from going negative
+
+
+diff --git a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java
+index ec579e7f1..9e5da2a0f 100644
+--- a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java
++++ b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java
+@@ -174,6 +174,12 @@ public class EntityAreaEffectCloud extends Entity {
+ super.B_();
+ boolean flag = this.q();
+ float f = this.getRadius();
++ // Paper start - fix MC-114618
++ if (f < 0.5F) {
++ this.die();
++ return;
++ }
++ // Paper end
+
+ if (this.world.isClientSide) {
+ EnumParticle enumparticle = this.getParticle();
+@@ -253,10 +259,12 @@ public class EntityAreaEffectCloud extends Entity {
+
+ if (this.radiusPerTick != 0.0F) {
+ f += this.radiusPerTick;
+- if (f < 0.5F) {
+- this.die();
+- return;
+- }
++ // Paper start - moved up - fix MC-114618
++ //if (f < 0.5F) {
++ // this.die();
++ // return;
++ //}
++ // Paper end
+
+ this.setRadius(f);
+ }
+--
+2.21.0
+
diff --git a/Spigot-Server-Patches/0384-Add-option-to-prevent-players-from-moving-into-unloa.patch b/Spigot-Server-Patches/0384-Add-option-to-prevent-players-from-moving-into-unloa.patch
new file mode 100644
index 0000000000..14f2fff2f0
--- /dev/null
+++ b/Spigot-Server-Patches/0384-Add-option-to-prevent-players-from-moving-into-unloa.patch
@@ -0,0 +1,69 @@
+From 252d777181440ac9c14bbbb85a26bcc42f498fb2 Mon Sep 17 00:00:00 2001
+From: Gabriele C <[email protected]>
+Date: Mon, 22 Oct 2018 17:34:10 +0200
+Subject: [PATCH] Add option to prevent players from moving into unloaded
+ chunks #1551
+
+
+diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+index 319b5b95d..897bb49b4 100644
+--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+@@ -593,4 +593,10 @@ public class PaperWorldConfig {
+ this.villageSiegesEnabled = getBoolean("game-mechanics.village-sieges-enabled", this.villageSiegesEnabled);
+ log("Village sieges are " + (this.villageSiegesEnabled ? "enabled" : "disabled"));
+ }
++
++ public boolean preventMovingIntoUnloadedChunks = false;
++ private void preventMovingIntoUnloadedChunks() {
++ preventMovingIntoUnloadedChunks = getBoolean("prevent-moving-into-unloaded-chunks", false);
++ log("Prevent players from moving into unloaded chunks: " + (this.preventMovingIntoUnloadedChunks ? "enabled" : "disabled"));
++ }
+ }
+diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java
+index 8c20bcd14..59d526329 100644
+--- a/src/main/java/net/minecraft/server/PlayerConnection.java
++++ b/src/main/java/net/minecraft/server/PlayerConnection.java
+@@ -343,6 +343,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
+ }
+ speed *= 2f; // TODO: Get the speed of the vehicle instead of the player
+
++ // Paper start - Prevent moving into unloaded chunks
++ if (player.world.paperConfig.preventMovingIntoUnloadedChunks && !worldserver.isChunkLoaded((int) Math.floor(packetplayinvehiclemove.getX()) >> 4, (int) Math.floor(packetplayinvehiclemove.getZ()) >> 4, false)) {
++ this.networkManager.sendPacket(new PacketPlayOutVehicleMove(entity));
++ return;
++ }
++ // Paper end
++
+ if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && (!this.minecraftServer.R() || !this.minecraftServer.Q().equals(entity.getName()))) { // Spigot
+ // CraftBukkit end
+ PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getName(), this.player.getName(), Double.valueOf(d6), Double.valueOf(d7), Double.valueOf(d8));
+@@ -539,9 +546,9 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
+ double d1 = this.player.locY;
+ double d2 = this.player.locZ;
+ double d3 = this.player.locY;
+- double d4 = packetplayinflying.a(this.player.locX);
++ double d4 = packetplayinflying.a(this.player.locX); double toX = d4; // Paper - OBFHELPER
+ double d5 = packetplayinflying.b(this.player.locY);
+- double d6 = packetplayinflying.c(this.player.locZ);
++ double d6 = packetplayinflying.c(this.player.locZ); double toZ = d6; // Paper - OBFHELPER
+ float f = packetplayinflying.a(this.player.yaw);
+ float f1 = packetplayinflying.b(this.player.pitch);
+ double d7 = d4 - this.l;
+@@ -581,6 +588,13 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable {
+ speed = player.abilities.walkSpeed * 10f;
+ }
+
++ // Paper start - Prevent moving into unloaded chunks
++ if (player.world.paperConfig.preventMovingIntoUnloadedChunks && (this.player.locX != toX || this.player.locZ != toZ) && !worldserver.isChunkLoaded((int) Math.floor(toX) >> 4, (int) Math.floor(toZ) >> 4, false)) {
++ this.internalTeleport(this.player.locX, this.player.locY, this.player.locZ, this.player.yaw, this.player.pitch, Collections.emptySet());
++ return;
++ }
++ // Paper end
++
+ if (!this.player.L() && (!this.player.x().getGameRules().getBoolean("disableElytraMovementCheck") || !this.player.cP())) {
+ float f2 = this.player.cP() ? 300.0F : 100.0F;
+
+--
+2.21.0
+