aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/removed
diff options
context:
space:
mode:
authorBjarne Koll <[email protected]>2024-10-22 23:30:51 +0200
committerBjarne Koll <[email protected]>2024-10-22 23:30:51 +0200
commitf1649d702bc5711635ea18c7e90270956f57aa66 (patch)
tree0b83684b70c7f037b7017c159de055f2a9637471 /patches/removed
parent9e92fed7a2c0d0f46b714bec84c5bc4d46c83cfb (diff)
downloadPaper-f1649d702bc5711635ea18c7e90270956f57aa66.tar.gz
Paper-f1649d702bc5711635ea18c7e90270956f57aa66.zip
Work it
Diffstat (limited to 'patches/removed')
-rw-r--r--patches/removed/1.21.2/0186-Block-Enderpearl-Travel-Exploit.patch50
1 files changed, 50 insertions, 0 deletions
diff --git a/patches/removed/1.21.2/0186-Block-Enderpearl-Travel-Exploit.patch b/patches/removed/1.21.2/0186-Block-Enderpearl-Travel-Exploit.patch
new file mode 100644
index 0000000000..677f86fec0
--- /dev/null
+++ b/patches/removed/1.21.2/0186-Block-Enderpearl-Travel-Exploit.patch
@@ -0,0 +1,50 @@
+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.
+
+Note: Currently removed as enderpearls are ticked as long as their owner is online in 1.21.2.
+Might be worth to re-add once an option to disable the above vanilla mechanic is added, to
+fully prevent enderpearl travel exploits.
+
+== 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 21c3d771a3dd921767c2cba1e11583d015879ca9..332d378979925f1197f4218919442688a4c47c23 100644
+--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
++++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
+@@ -2194,6 +2194,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+
+ 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 fed01aea47090b990939becde837add6c36bf418..a1840bb4a3307492f80f93c4433eec3be7f862f1 100644
+--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
++++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
+@@ -116,6 +116,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
+ protected void readAdditionalSaveData(CompoundTag nbt) {
+ if (nbt.hasUUID("Owner")) {
+ this.setOwnerThroughUUID(nbt.getUUID("Owner"));
++ 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");