mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-27 21:26:29 +01:00
Additional checks when resetting compass location, see #1117
This commit is contained in:
parent
0fec3b35fe
commit
51179e6f5a
@ -3559,19 +3559,23 @@ 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;
|
||||||
|
if (defaultLocation != null) {
|
||||||
player.setCompassTarget(defaultLocation);
|
player.setCompassTarget(defaultLocation);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update compass target to current stage of first available current quest, if possible
|
* Update compass target to current stage of first available current quest, if possible
|
||||||
|
Loading…
Reference in New Issue
Block a user