2016-03-01 00:23:45 +00:00
|
|
|
From 1ba0da9d71e285dd8b937386a676bdac5b218393 Mon Sep 17 00:00:00 2001
|
2014-07-21 20:46:54 +00:00
|
|
|
From: ninja <xninja@openmailbox.org>
|
|
|
|
Date: Tue, 8 Apr 2014 14:05:19 +0200
|
|
|
|
Subject: [PATCH] Implement PlayerSpawnLocationEvent.
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
2016-02-29 21:33:06 +00:00
|
|
|
index 9f0842c..6eb509c 100644
|
2014-07-21 20:46:54 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
2014-12-13 04:47:57 +00:00
|
|
|
@@ -36,6 +36,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
2014-07-21 20:46:54 +00:00
|
|
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
|
|
|
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
|
|
|
import org.bukkit.util.Vector;
|
|
|
|
+import org.spigotmc.event.player.PlayerSpawnLocationEvent;
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
public abstract class PlayerList {
|
2015-02-06 10:08:31 +00:00
|
|
|
@@ -105,6 +106,19 @@ public abstract class PlayerList {
|
2014-07-21 20:46:54 +00:00
|
|
|
s1 = networkmanager.getSocketAddress().toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // Spigot start - spawn location event
|
|
|
|
+ Player bukkitPlayer = entityplayer.getBukkitEntity();
|
|
|
|
+ PlayerSpawnLocationEvent ev = new PlayerSpawnLocationEvent(bukkitPlayer, bukkitPlayer.getLocation());
|
|
|
|
+ Bukkit.getPluginManager().callEvent(ev);
|
|
|
|
+
|
|
|
|
+ Location loc = ev.getSpawnLocation();
|
|
|
|
+ WorldServer world = ((CraftWorld) loc.getWorld()).getHandle();
|
|
|
|
+
|
|
|
|
+ entityplayer.spawnIn(world);
|
|
|
|
+ entityplayer.setPosition(loc.getX(), loc.getY(), loc.getZ());
|
2014-11-28 01:17:45 +00:00
|
|
|
+ entityplayer.setYawPitch(loc.getYaw(), loc.getPitch());
|
2014-07-21 20:46:54 +00:00
|
|
|
+ // Spigot end
|
|
|
|
+
|
|
|
|
// CraftBukkit - Moved message to after join
|
2015-02-28 11:36:22 +00:00
|
|
|
// PlayerList.f.info(entityplayer.getName() + "[" + s1 + "] logged in with entity id " + entityplayer.getId() + " at (" + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")");
|
2014-07-21 20:46:54 +00:00
|
|
|
WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension);
|
|
|
|
--
|
2016-02-29 21:33:06 +00:00
|
|
|
2.5.0
|
2014-07-21 20:46:54 +00:00
|
|
|
|