2020-05-06 09:48:49 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2018-04-30 21:21:59 +00: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
2021-01-11 01:44:06 +00:00
index cebf1a623a9bec72d60fdd23dda01868ef6431d4..e8e1e7dafaf1c105b2f58cf3e118e3d665dc50ec 100644
2018-04-30 21:21:59 +00:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2021-01-11 01:44:06 +00:00
@@ -363,4 +363,10 @@ public class PaperWorldConfig {
2018-07-18 18:55:52 +00:00
private void disableSprintInterruptionOnAttack() {
disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false);
2018-04-30 21:21:59 +00: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"));
+ }
}
2021-03-16 07:19:45 +00:00
diff --git a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
2021-05-09 20:50:09 +00:00
index 5c9ffd02b4f2977ee13a962a214887f74c91594f..8f14e1ebefe172e056a04bd7b6f55b9bbb1e7b2e 100644
2021-03-16 07:19:45 +00:00
--- a/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/IProjectile.java
2021-05-09 20:50:09 +00:00
@@ -63,6 +63,7 @@ public abstract class IProjectile extends Entity {
2020-06-25 14:09:55 +00:00
protected void loadData(NBTTagCompound nbttagcompound) {
if (nbttagcompound.b("Owner")) {
this.shooter = nbttagcompound.a("Owner");
+ if (this instanceof EntityEnderPearl && this.world != null && this.world.paperConfig.disableEnderpearlExploit) { this.shooter = null; } // Paper - Don't store shooter name for pearls to block enderpearl travel exploit
2018-04-30 21:21:59 +00:00
}
2018-07-18 18:55:52 +00:00
2020-06-25 14:09:55 +00:00
this.d = nbttagcompound.getBoolean("LeftOwner");