mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
b06cb423cb
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: b999860d SPIGOT-2304: Add LootGenerateEvent CraftBukkit Changes:77fd87e4
SPIGOT-2304: Implement LootGenerateEventa1a705ee
SPIGOT-5566: Doused campfires & fires should call EntityChangeBlockEvent41712edd
SPIGOT-5707: PersistentDataHolder not Persistent on API dropped Item
32 lines
No EOL
1.6 KiB
Diff
32 lines
No EOL
1.6 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Steve Anton <anxuiz.nx@gmail.com>
|
|
Date: Thu, 3 Mar 2016 00:09:38 -0600
|
|
Subject: [PATCH] Add PlayerInitialSpawnEvent
|
|
|
|
For modifying a player's initial spawn location as they join the server
|
|
|
|
This is a duplicate API from spigot, so use our duplicate subclass and
|
|
improve setPosition to use raw
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
|
index f28be11eee..541e3ce830 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
|
@@ -0,0 +0,0 @@ public abstract class PlayerList {
|
|
|
|
// 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();
|
|
worldserver = ((CraftWorld) loc.getWorld()).getHandle();
|
|
|
|
entityplayer.spawnIn(worldserver);
|
|
- 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
|
|
|
|
--
|