Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-17 05:20:05 +01:00
1c49ff69f4
The hell happened here. : Fix Build 2339ac14a8e Regen the patches 89d3fcbdfaf This new system breaks a lot :(
42 Zeilen
1.8 KiB
Diff
42 Zeilen
1.8 KiB
Diff
From 57153fb375acd95b5a4ef6c5c88c12dffa783b26 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 c9ef1d6..26e4328 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
|
@@ -35,6 +35,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 {
|
|
@@ -98,6 +99,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.setYawPitch(loc.getYaw(), loc.getPitch());
|
|
+ // Spigot end
|
|
+
|
|
// CraftBukkit - Moved message to after join
|
|
// PlayerList.h.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);
|
|
--
|
|
2.1.0
|
|
|