2020-05-06 09:48:49 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2015-12-23 04:06:19 +00:00
From: Steve Anton <anxuiz.nx@gmail.com>
2016-02-29 23:09:49 +00:00
Date: Thu, 3 Mar 2016 00:09:38 -0600
2015-12-23 04:06:19 +00:00
Subject: [PATCH] Add PlayerInitialSpawnEvent
For modifying a player's initial spawn location as they join the server
2020-04-19 07:11:02 +00:00
This is a duplicate API from spigot, so use our duplicate subclass and
improve setPosition to use raw
2015-12-23 04:06:19 +00:00
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
2020-07-22 23:35:44 +00:00
index 60a8fdbd6e458dfdc3e4449d71464bb5d5c5bd20..107d18b028e042f7de505ea2a58a8dc2b9bf0fb3 100644
2015-12-23 04:06:19 +00:00
--- a/src/main/java/net/minecraft/server/PlayerList.java
+++ b/src/main/java/net/minecraft/server/PlayerList.java
2020-06-27 05:12:11 +00:00
@@ -143,7 +143,7 @@ public abstract class PlayerList {
2020-04-19 07:11:02 +00:00
// Spigot start - spawn location event
Player bukkitPlayer = entityplayer.getBukkitEntity();
- PlayerSpawnLocationEvent ev = new PlayerSpawnLocationEvent(bukkitPlayer, bukkitPlayer.getLocation());
+ PlayerSpawnLocationEvent ev = new com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent(bukkitPlayer, bukkitPlayer.getLocation()); // Paper use our duplicate event
Bukkit.getPluginManager().callEvent(ev);
Location loc = ev.getSpawnLocation();
2020-06-27 05:12:11 +00:00
@@ -151,7 +151,7 @@ public abstract class PlayerList {
2015-12-23 04:06:19 +00:00
2020-06-27 05:12:11 +00:00
entityplayer.spawnIn(worldserver1);
entityplayer.playerInteractManager.a((WorldServer) entityplayer.world);
2020-04-19 07:11:02 +00:00
- entityplayer.setPosition(loc.getX(), loc.getY(), loc.getZ());
+ entityplayer.setPositionRaw(loc.getX(), loc.getY(), loc.getZ()); // Paper - set raw so we aren't fully joined to the world (not added to chunk or world)
entityplayer.setYawPitch(loc.getYaw(), loc.getPitch());
// Spigot end
2019-04-25 06:53:51 +00:00