aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0186-Block-Enderpearl-Travel-Exploit.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/server/0186-Block-Enderpearl-Travel-Exploit.patch')
-rw-r--r--patches/server/0186-Block-Enderpearl-Travel-Exploit.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/patches/server/0186-Block-Enderpearl-Travel-Exploit.patch b/patches/server/0186-Block-Enderpearl-Travel-Exploit.patch
new file mode 100644
index 0000000000..c538b3c38a
--- /dev/null
+++ b/patches/server/0186-Block-Enderpearl-Travel-Exploit.patch
@@ -0,0 +1,46 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Mon, 30 Apr 2018 17:15:26 -0400
+Subject: [PATCH] Block Enderpearl Travel Exploit
+
+Players are able to use alt accounts and enderpearls to travel
+long distances utilizing the pearls in unloaded chunks and loading
+the chunk later when convenient.
+
+This disables that by not saving the thrower when the chunk is unloaded.
+
+This is mainly useful for survival servers that do not allow freeform teleporting.
+
+== AT ==
+public net.minecraft.world.entity.projectile.Projectile cachedOwner
+public net.minecraft.world.entity.projectile.Projectile ownerUUID
+
+diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
+index d728afbe1d6882f1ace4ead9d87f4b7d2af43ba2..7c6b094de5e29cb2663e8a7072a27d7adbceb4b2 100644
+--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
++++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
+@@ -2111,6 +2111,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
+
+ public void onTickingEnd(Entity entity) {
+ ServerLevel.this.entityTickList.remove(entity);
++ // Paper start - Reset pearls when they stop being ticked
++ if (paperConfig().fixes.disableUnloadedChunkEnderpearlExploit && entity instanceof net.minecraft.world.entity.projectile.ThrownEnderpearl pearl) {
++ pearl.cachedOwner = null;
++ pearl.ownerUUID = null;
++ }
++ // Paper end - Reset pearls when they stop being ticked
+ }
+
+ public void onTrackingStart(Entity entity) {
+diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+index add45e6e95688649ba4b8d67747f763a261da51e..a39de724848d6dc796dd99dde5206f20e513fd18 100644
+--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
++++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+@@ -108,6 +108,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
+ if (nbt.hasUUID("Owner")) {
+ this.ownerUUID = nbt.getUUID("Owner");
+ this.cachedOwner = null;
++ if (this instanceof ThrownEnderpearl && this.level() != null && this.level().paperConfig().fixes.disableUnloadedChunkEnderpearlExploit) { this.ownerUUID = null; } // Paper - Reset pearls when they stop being ticked; Don't store shooter name for pearls to block enderpearl travel exploit
+ }
+
+ this.leftOwner = nbt.getBoolean("LeftOwner");