Permit numbers in world names with spaces, untested, fixes #124

This commit is contained in:
HappyPikachu 2017-12-04 22:38:33 -05:00
parent 341cafb17a
commit 1b2eb65a10
2 changed files with 15 additions and 15 deletions

View File

@ -3,7 +3,7 @@
<groupId>me.blackvein.quests</groupId>
<artifactId>quests</artifactId>
<version>3.0.8</version>
<version>3.0.9</version>
<name>quests</name>
<url>https://github.com/FlyingPikachu/Quests/</url>
<packaging>jar</packaging>

View File

@ -3401,18 +3401,16 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
StringBuilder sb = new StringBuilder();
int index = 0;
int xIndex = info.length -3;
int yIndex = info.length -2;
int zIndex = info.length -1;
for (String s : info) {
try {
Double.parseDouble(s);
break;
} catch (Exception e) {
if (index == 0) {
sb.append(s);
} else {
sb.append(" " + s);
}
index++;
while (index < xIndex) {
String s = info[index];
if (index == 0) {
sb.append(s);
} else {
sb.append(" " + s);
}
}
@ -3422,10 +3420,12 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
double y;
double z;
try {
x = Double.parseDouble(info[index]);
y = Double.parseDouble(info[index + 1]);
z = Double.parseDouble(info[index + 2]);
x = Double.parseDouble(info[xIndex]);
y = Double.parseDouble(info[yIndex]);
z = Double.parseDouble(info[zIndex]);
} catch (Exception e) {
Bukkit.getLogger().severe("Please inform developer location was wrong for "
+ world + " " + info[xIndex] + " " + info[yIndex] + " " + info[zIndex] + " ");
return null;
}
if (Bukkit.getServer().getWorld(world) == null) {