2019-07-20 06:01:24 +02:00
From f63e5fd2593cbe46eb018bcd6c08ca23a319310f Mon Sep 17 00:00:00 2001
2018-04-30 23:21:59 +02:00
From: Aikar <aikar@aikar.co>
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.
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2019-07-20 06:01:24 +02:00
index 0b6e812d8d..da10550030 100644
2018-04-30 23:21:59 +02:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2019-07-03 22:44:07 +02:00
@@ -354,4 +354,10 @@ public class PaperWorldConfig {
2018-07-18 20:55:52 +02:00
private void disableSprintInterruptionOnAttack() {
disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false);
2018-04-30 23:21:59 +02:00
}
+
+ public boolean disableEnderpearlExploit = true;
+ private void disableEnderpearlExploit() {
+ disableEnderpearlExploit = getBoolean("game-mechanics.disable-unloaded-chunk-enderpearl-exploit", disableEnderpearlExploit);
+ log("Disable Unloaded Chunk Enderpearl Exploit: " + (disableEnderpearlExploit ? "enabled" : "disabled"));
+ }
}
diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java
2019-07-20 06:01:24 +02:00
index 5f0cb4c33d..f2f4b2d929 100644
2018-04-30 23:21:59 +02:00
--- a/src/main/java/net/minecraft/server/EntityProjectile.java
+++ b/src/main/java/net/minecraft/server/EntityProjectile.java
2019-04-29 05:14:31 +02:00
@@ -205,6 +205,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
2018-07-18 20:55:52 +02:00
if (nbttagcompound.hasKeyOfType("owner", 10)) {
this.shooterId = GameProfileSerializer.b(nbttagcompound.getCompound("owner"));
2018-04-30 23:21:59 +02:00
}
2018-07-19 06:42:43 +02:00
+ if (this instanceof EntityEnderPearl && this.world != null && this.world.paperConfig.disableEnderpearlExploit) { this.shooterId = null; } // Paper - Don't store shooter name for pearls to block enderpearl travel exploit
2018-04-30 23:21:59 +02:00
}
2018-07-18 20:55:52 +02:00
2018-04-30 23:21:59 +02:00
--
2019-06-25 21:18:50 +02:00
2.22.0
2018-04-30 23:21:59 +02:00