mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 09:23:42 +01:00
0faaa7da92
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 19b7b7bd #561: Add clear weather World API 5929c808 #552: Add the ability to retrieve hit, step, fall, and other sounds from blocks. CraftBukkit Changes: e1ebdd92 #771: Add clear weather World API 424598d2 #752: Add the ability to retrieve hit, step, fall, and other sounds from blocks.
44 lines
2.5 KiB
Diff
44 lines
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Sudzzy <originmc@outlook.com>
|
|
Date: Thu, 3 Mar 2016 02:50:31 -0600
|
|
Subject: [PATCH] Configurable inter-world teleportation safety
|
|
|
|
People are able to abuse the way Bukkit handles teleportation across worlds since it provides a built in teleportation
|
|
safety check.
|
|
|
|
To abuse the safety check, players are required to get into a location deemed unsafe by Bukkit e.g. be within a chest
|
|
or door block. While they are in this block, they accept a teleport request from a player within a different world. Once
|
|
the player teleports, Minecraft will recursively search upwards for a safe location, this could eventually land within a
|
|
player's skybase.
|
|
|
|
Example setup to perform the glitch: http://puu.sh/ng3PC/cf072dcbdb.png
|
|
The wanted destination was on top of the emerald block however the player ended on top of the diamond block.
|
|
This only is the case if the player is teleporting between worlds.
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
index cff769a0cffd81501f919fad0c6456e1268bd223..a6c02f676f4206f2f59862530999cd74a2e0c20f 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
|
@@ -199,4 +199,9 @@ public class PaperWorldConfig {
|
|
portalSearchRadius = getInt("portal-search-radius", 128);
|
|
portalCreateRadius = getInt("portal-create-radius", 16);
|
|
}
|
|
+
|
|
+ public boolean disableTeleportationSuffocationCheck;
|
|
+ private void disableTeleportationSuffocationCheck() {
|
|
+ disableTeleportationSuffocationCheck = getBoolean("disable-teleportation-suffocation-check", false);
|
|
+ }
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
index 4a7ac9ddbfa221645f68be34db4b5704661ef5a6..000cd89542122960649e42e9cad334f1da3514a9 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -783,7 +783,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
if (fromWorld == toWorld) {
|
|
entity.playerConnection.teleport(to);
|
|
} else {
|
|
- server.getHandle().moveToWorld(entity, toWorld, true, to, true);
|
|
+ server.getHandle().moveToWorld(entity, toWorld, true, to, !toWorld.paperConfig.disableTeleportationSuffocationCheck); // Paper
|
|
}
|
|
return true;
|
|
}
|