mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-24 03:25:20 +01:00
Additional checks when resetting compass location, see #1117
This commit is contained in:
parent
0fec3b35fe
commit
51179e6f5a
@ -3559,18 +3559,22 @@ public class Quester {
|
|||||||
* Will set to Quester's spawn location if bed spawn does not exist
|
* Will set to Quester's spawn location if bed spawn does not exist
|
||||||
*/
|
*/
|
||||||
public void resetCompass() {
|
public void resetCompass() {
|
||||||
|
Player player = getPlayer();
|
||||||
|
if (player == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (!getPlayer().hasPermission("quests.compass")) {
|
if (!getPlayer().hasPermission("quests.compass")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Player player = getPlayer();
|
|
||||||
if (player == null)
|
|
||||||
return;
|
|
||||||
Location defaultLocation = player.getBedSpawnLocation();
|
Location defaultLocation = player.getBedSpawnLocation();
|
||||||
if (defaultLocation == null) {
|
if (defaultLocation == null) {
|
||||||
defaultLocation = player.getWorld().getSpawnLocation();
|
defaultLocation = player.getWorld().getSpawnLocation();
|
||||||
}
|
}
|
||||||
compassTargetQuestId = null;
|
compassTargetQuestId = null;
|
||||||
player.setCompassTarget(defaultLocation);
|
if (defaultLocation != null) {
|
||||||
|
player.setCompassTarget(defaultLocation);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user