aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/unapplied/server/0513-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/unapplied/server/0513-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch')
-rw-r--r--patches/unapplied/server/0513-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch26
1 files changed, 26 insertions, 0 deletions
diff --git a/patches/unapplied/server/0513-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch b/patches/unapplied/server/0513-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch
new file mode 100644
index 0000000000..852f5276ee
--- /dev/null
+++ b/patches/unapplied/server/0513-Expand-PlayerRespawnEvent-fix-passed-parameter-issue.patch
@@ -0,0 +1,26 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: HexedHero <[email protected]>
+Date: Fri, 23 Apr 2021 22:42:42 +0100
+Subject: [PATCH] Expand PlayerRespawnEvent, fix passed parameter issues
+
+Co-authored-by: Jake Potrebic <[email protected]>
+
+diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
+index 5571e89876317e7b4b304bb1ec9c31078d0f69ee..563b20033a5280091f93ab72a8600369035b6a0a 100644
+--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
++++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
+@@ -1456,7 +1456,13 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player {
+ Player respawnPlayer = this.getBukkitEntity();
+ Location location = CraftLocation.toBukkit(teleportTransition.position(), teleportTransition.newLevel().getWorld(), teleportTransition.yRot(), teleportTransition.xRot());
+
+- PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn, isAnchorSpawn, reason);
++ // Paper start - respawn flags
++ com.google.common.collect.ImmutableSet.Builder<org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag> builder = com.google.common.collect.ImmutableSet.builder();
++ if (reason == org.bukkit.event.player.PlayerRespawnEvent.RespawnReason.END_PORTAL) {
++ builder.add(org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag.END_PORTAL);
++ }
++ PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(respawnPlayer, location, isBedSpawn, isAnchorSpawn, reason, builder);
++ // Paper end - respawn flags
+ this.level().getCraftServer().getPluginManager().callEvent(respawnEvent);
+ // Spigot Start
+ if (this.connection.isDisconnected()) {