mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 10:20:53 +01:00
cab333b217
Don't send requests of every player was found in the global api cache SpigotMC/Spigot@841270ff1e Correctly set the response code for the cached lookups and return the ... SpigotMC/Spigot@f170b7899c Don't try and re-set the global api cache on reload SpigotMC/Spigot@b410a00a66 Use a compile time sneaky throw hack. SpigotMC/Spigot@508462b96b Fix a missed rename in WorldGenGroundBush SpigotMC/Spigot@0614d8fae9
42 lines
1.8 KiB
Diff
42 lines
1.8 KiB
Diff
From 65748d5b5c27ce3e6ad792546a6a63e2080c703e Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 4b8835d..ea9fcd9 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
|
@@ -36,6 +36,7 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|
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 {
|
|
@@ -99,6 +100,19 @@ public abstract class PlayerList {
|
|
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());
|
|
+ entityplayer.b(loc.getYaw(), loc.getPitch()); // should be setYawAndPitch
|
|
+ // Spigot end
|
|
+
|
|
// CraftBukkit - Moved message to after join
|
|
// g.info(entityplayer.getName() + "[" + s1 + "] logged in with entity id " + entityplayer.getId() + " at (" + entityplayer.locX + ", " + entityplayer.locY + ", " + entityplayer.locZ + ")");
|
|
WorldServer worldserver = this.server.getWorldServer(entityplayer.dimension);
|
|
--
|
|
1.9.1
|
|
|