mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@1e67ca8e Add SpawnReason for REANIMATE a Copper Golem Statue (#13126) PaperMC/Paper@e75678b6 Update Mache for Java 25 setup runtime support PaperMC/Paper@bac3da12 Migrate external JD links from javadoc.io to javadocs.dev (#13205) PaperMC/Paper@080a72f2 [ci/skip] Add myself (roro1506HD) to MIT licensing (#13212) PaperMC/Paper@d98142ef Rework API teleportation to better align with Vanilla (#13181)
31 lines
1.8 KiB
Diff
31 lines
1.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Mariell Hoversholm <proximyst@proximyst.com>
|
|
Date: Sat, 9 Jan 2021 15:26:04 +0100
|
|
Subject: [PATCH] Add EntityTeleportHinderedEvent
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
index ecb01b035d81a42911db1c8364e23ccba4a8b790..56bbaab57432a78e85bc0013cd7f991f662f0cd2 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
@@ -1382,6 +1382,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player, PluginMessa
|
|
// Minecraft does not currently support teleporting players between worlds with passengers.
|
|
// It causes them to be dismounted, and causes weird behavior.
|
|
if (location.getWorld() != this.getWorld() && !this.getHandle().passengers.isEmpty()) {
|
|
+ if (!new org.purpurmc.purpur.event.entity.EntityTeleportHinderedEvent(entity.getBukkitEntity(), org.purpurmc.purpur.event.entity.EntityTeleportHinderedEvent.Reason.IS_VEHICLE, cause).callEvent()) // Purpur - Add EntityTeleportHinderedEvent
|
|
return false;
|
|
}
|
|
|