Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 21:10:17 +01:00
Fixed potential NPE with bed leave event.
Dieser Commit ist enthalten in:
Ursprung
86c467cb50
Commit
8de85b8afb
@ -662,7 +662,12 @@ public abstract class EntityHuman extends EntityLiving {
|
||||
if (this.getBukkitEntity() instanceof Player) {
|
||||
Player player = (Player) this.getBukkitEntity();
|
||||
CraftServer server = ((WorldServer) world).getServer();
|
||||
org.bukkit.block.Block bed = ((WorldServer) world).getWorld().getBlockAt(this.b.a, this.b.b, this.b.c);
|
||||
org.bukkit.block.Block bed;
|
||||
if (chunkcoordinates != null) {
|
||||
bed = ((WorldServer) world).getWorld().getBlockAt(chunkcoordinates.a, chunkcoordinates.b, chunkcoordinates.c);
|
||||
} else {
|
||||
bed = ((WorldServer) world).getWorld().getBlockAt(player.getLocation());
|
||||
}
|
||||
PlayerBedLeaveEvent event = new PlayerBedLeaveEvent(player, bed);
|
||||
server.getPluginManager().callEvent(event);
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren