mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 05:25:42 +01:00
Added getBedSpawnLocation to CraftPlayer. Thanks fernferret!
This commit is contained in:
parent
3f04f04be6
commit
905b977670
@ -22,6 +22,7 @@ import org.bukkit.Location;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Note;
|
import org.bukkit.Note;
|
||||||
import org.bukkit.Statistic;
|
import org.bukkit.Statistic;
|
||||||
|
import org.bukkit.World;
|
||||||
import org.bukkit.craftbukkit.CraftServer;
|
import org.bukkit.craftbukkit.CraftServer;
|
||||||
import org.bukkit.craftbukkit.CraftWorld;
|
import org.bukkit.craftbukkit.CraftWorld;
|
||||||
import org.bukkit.craftbukkit.map.CraftMapView;
|
import org.bukkit.craftbukkit.map.CraftMapView;
|
||||||
@ -483,4 +484,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
public void setFoodLevel(int value) {
|
public void setFoodLevel(int value) {
|
||||||
getHandle().getFoodData().foodLevel = value;
|
getHandle().getFoodData().foodLevel = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Location getBedSpawnLocation() {
|
||||||
|
World world = getServer().getWorld(getHandle().spawnWorld);
|
||||||
|
if (world != null) {
|
||||||
|
return new Location(world, getHandle().getBed().x, getHandle().getBed().y, getHandle().getBed().z);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user