fix IndexOutOfBoundsException when getting the selection from the wand

This commit is contained in:
Julian Krings 2025-06-09 19:50:50 +02:00
parent 9316ea9e5b
commit cd80acdc7d
No known key found for this signature in database
GPG Key ID: 208C6E08C3B718D2

View File

@ -201,7 +201,9 @@ public class WandSVC implements IrisService {
public static Location stringToLocation(String s) {
try {
String[] f = s.split("\\Q in \\E");
if (f.length != 2) return null;
String[] g = f[0].split("\\Q,\\E");
if (g.length != 3) return null;
return new Location(Bukkit.getWorld(f[1]), Integer.parseInt(g[0]), Integer.parseInt(g[1]), Integer.parseInt(g[2]));
} catch (Throwable e) {
Iris.reportError(e);