mirror of
https://github.com/PaperMC/Paper.git
synced 2024-09-12 06:58:11 +02:00
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
66 lines
1.9 KiB
Diff
66 lines
1.9 KiB
Diff
From 18efac72ae78fa2b9ae87f7b31d2d9d3a2348e93 Mon Sep 17 00:00:00 2001
|
|
From: ninja <xninja@openmailbox.org>
|
|
Date: Tue, 8 Apr 2014 14:01:32 +0200
|
|
Subject: [PATCH] Add PlayerSpawnLocationEvent.
|
|
|
|
|
|
diff --git a/src/main/java/org/spigotmc/event/player/PlayerSpawnLocationEvent.java b/src/main/java/org/spigotmc/event/player/PlayerSpawnLocationEvent.java
|
|
new file mode 100644
|
|
index 0000000..dd3f58c
|
|
--- /dev/null
|
|
+++ b/src/main/java/org/spigotmc/event/player/PlayerSpawnLocationEvent.java
|
|
@@ -0,0 +1,50 @@
|
|
+package org.spigotmc.event.player;
|
|
+
|
|
+import org.bukkit.Location;
|
|
+import org.bukkit.entity.Entity;
|
|
+import org.bukkit.entity.Player;
|
|
+import org.bukkit.event.HandlerList;
|
|
+import org.bukkit.event.player.PlayerEvent;
|
|
+
|
|
+/**
|
|
+ * Called when player is about to spawn in a world after joining the server.
|
|
+ */
|
|
+public class PlayerSpawnLocationEvent extends PlayerEvent {
|
|
+ private static final HandlerList handlers = new HandlerList();
|
|
+ private Location spawnLocation;
|
|
+
|
|
+ public PlayerSpawnLocationEvent(final Player who, Location spawnLocation) {
|
|
+ super(who);
|
|
+ this.spawnLocation = spawnLocation;
|
|
+ }
|
|
+
|
|
+
|
|
+ /**
|
|
+ * Gets player's spawn location.
|
|
+ * If the player {@link Player#hasPlayedBefore()}, it's going to default to the location inside player.dat file.
|
|
+ * For new players, the default spawn location is spawn of the main Bukkit world.
|
|
+ *
|
|
+ * @return the spawn location
|
|
+ */
|
|
+ public Location getSpawnLocation() {
|
|
+ return spawnLocation;
|
|
+ }
|
|
+
|
|
+ /**
|
|
+ * Sets player's spawn location.
|
|
+ *
|
|
+ * @param location the spawn location
|
|
+ */
|
|
+ public void setSpawnLocation(Location location) {
|
|
+ this.spawnLocation = location;
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public HandlerList getHandlers() {
|
|
+ return handlers;
|
|
+ }
|
|
+
|
|
+ public static HandlerList getHandlerList() {
|
|
+ return handlers;
|
|
+ }
|
|
+}
|
|
--
|
|
1.9.1
|
|
|