2018-07-04 09:55:24 +02:00
From da411565a450dfde5e88a3a952b09b3c6f182340 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
2018-06-30 07:40:52 +02:00
index 99d681ef1..03a9a96fc 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
2018-05-30 22:31:55 +02:00
@@ -513,4 +513,10 @@ public class PaperWorldConfig {
2018-04-30 23:21:59 +02:00
allowPermaChunkLoaders = getBoolean("game-mechanics.allow-permanent-chunk-loaders", allowPermaChunkLoaders);
log("Allow Perma Chunk Loaders: " + (allowPermaChunkLoaders ? "enabled" : "disabled"));
}
+
+ 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
2018-06-30 07:40:52 +02:00
index 01c7fcc8b..8e6428a0c 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
2018-05-01 23:03:12 +02:00
@@ -271,6 +271,7 @@ public abstract class EntityProjectile extends Entity implements IProjectile {
if (this.shooterName != null && this.shooterName.isEmpty()) {
this.shooterName = null;
2018-04-30 23:21:59 +02:00
}
+ if (this instanceof EntityEnderPearl && this.world != null && this.world.paperConfig.disableEnderpearlExploit) { this.shooterName = null; } // Paper - Don't store shooter name for pearls to block enderpearl travel exploit
2018-05-01 23:03:12 +02:00
this.shooter = this.getShooter();
2018-04-30 23:21:59 +02:00
}
--
2018-06-30 07:40:52 +02:00
2.18.0
2018-04-30 23:21:59 +02:00