Skip to content

Commit

Permalink
chore: show raw lkey when convert failed
Browse files Browse the repository at this point in the history
  • Loading branch information
StarWishsama committed Dec 24, 2024
1 parent 80d3faa commit 2017d3d
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package com.xzavier0722.mc.plugin.slimefun4.storage.util;

import city.norain.slimefun4.SlimefunExtended;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;

import java.util.logging.Level;

import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
Expand All @@ -20,13 +24,17 @@ public static Location toLocation(String lKey) {
return null;
}

var strArr = lKey.split(";");
var loc = strArr[1].split(":");
return new Location(
try {
var strArr = lKey.split(";");
var loc = strArr[1].split(":");
return new Location(
Bukkit.getWorld(strArr[0]),
Double.parseDouble(loc[0]),
Double.parseDouble(loc[1]),
Double.parseDouble(loc[2]));
} catch (Exception e) {
throw new RuntimeException("Unable to parse location [" + lKey + "]", e);
}
}

public static boolean isSameChunk(Chunk c1, Chunk c2) {
Expand Down

0 comments on commit 2017d3d

Please sign in to comment.