mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-14 14:45:41 +01:00
Ensure reach-location is in the same world, fixes #385
This commit is contained in:
parent
c5dabefc32
commit
3e5115d64d
@ -1155,6 +1155,7 @@ public class Quester {
|
|||||||
if (l.getX() < (locationToReach.getX() + radius) && l.getX() > (locationToReach.getX() - radius)) {
|
if (l.getX() < (locationToReach.getX() + radius) && l.getX() > (locationToReach.getX() - radius)) {
|
||||||
if (l.getZ() < (locationToReach.getZ() + radius) && l.getZ() > (locationToReach.getZ() - radius)) {
|
if (l.getZ() < (locationToReach.getZ() + radius) && l.getZ() > (locationToReach.getZ() - radius)) {
|
||||||
if (l.getY() < (locationToReach.getY() + radius) && l.getY() > (locationToReach.getY() - radius)) {
|
if (l.getY() < (locationToReach.getY() + radius) && l.getY() > (locationToReach.getY() - radius)) {
|
||||||
|
if (l.getWorld().getName().equals(locationToReach.getWorld().getName())) {
|
||||||
if (getQuestData(quest).hasReached.get(index) == false) {
|
if (getQuestData(quest).hasReached.get(index) == false) {
|
||||||
getQuestData(quest).hasReached.set(index, true);
|
getQuestData(quest).hasReached.set(index, true);
|
||||||
finishObjective(quest, "reachLocation", null, null, null, null, null, null, location, null, null, null);
|
finishObjective(quest, "reachLocation", null, null, null, null, null, null, location, null, null, null);
|
||||||
@ -1162,6 +1163,7 @@ public class Quester {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (IndexOutOfBoundsException e) {
|
} catch (IndexOutOfBoundsException e) {
|
||||||
plugin.getLogger().severe("An error has occurred with Quests. Please report on Github. Include the info below");
|
plugin.getLogger().severe("An error has occurred with Quests. Please report on Github. Include the info below");
|
||||||
plugin.getLogger().severe("index = " + getQuestData(quest).locationsReached.indexOf(location));
|
plugin.getLogger().severe("index = " + getQuestData(quest).locationsReached.indexOf(location));
|
||||||
|
@ -3581,11 +3581,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
|||||||
y = Double.parseDouble(info[yIndex]);
|
y = Double.parseDouble(info[yIndex]);
|
||||||
z = Double.parseDouble(info[zIndex]);
|
z = Double.parseDouble(info[zIndex]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Bukkit.getLogger().severe("Please inform developer location was wrong for "
|
Bukkit.getLogger().severe("Please inform Quests developer location was wrong for "
|
||||||
+ world + " " + info[xIndex] + " " + info[yIndex] + " " + info[zIndex] + " ");
|
+ world + " " + info[xIndex] + " " + info[yIndex] + " " + info[zIndex] + " ");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (Bukkit.getServer().getWorld(world) == null) {
|
if (Bukkit.getServer().getWorld(world) == null) {
|
||||||
|
Bukkit.getLogger().severe("Quests could not locate world " + world + ", is it loaded?");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Location finalLocation = new Location(Bukkit.getServer().getWorld(world), x, y, z);
|
Location finalLocation = new Location(Bukkit.getServer().getWorld(world), x, y, z);
|
||||||
|
Loading…
Reference in New Issue
Block a user