trying bedspawn
This commit is contained in:
parent
55fe6d9001
commit
a06e712bf4
3 changed files with 2 additions and 2 deletions
Binary file not shown.
Binary file not shown.
|
@ -49,7 +49,7 @@ public class PlayerListener implements Listener {
|
||||||
public void onPlayerRespawn(PlayerRespawnEvent e) {
|
public void onPlayerRespawn(PlayerRespawnEvent e) {
|
||||||
final Player p = e.getPlayer();
|
final Player p = e.getPlayer();
|
||||||
p.setGameMode(GameMode.SPECTATOR);
|
p.setGameMode(GameMode.SPECTATOR);
|
||||||
spawn = p.getLocation();
|
this.spawn = p.getBedSpawnLocation();
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -67,7 +67,7 @@ public class PlayerListener implements Listener {
|
||||||
public void onPlayerMove(PlayerMoveEvent e) {
|
public void onPlayerMove(PlayerMoveEvent e) {
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
if (p.getGameMode() == GameMode.SPECTATOR) {
|
if (p.getGameMode() == GameMode.SPECTATOR) {
|
||||||
p.teleport(spawn);
|
p.teleport(this.spawn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue