diff --git a/src/main/java/com/andrew121410/mc/world16essentials/utils/API.java b/src/main/java/com/andrew121410/mc/world16essentials/utils/API.java index 2fc7f0ef..a205bf4c 100644 --- a/src/main/java/com/andrew121410/mc/world16essentials/utils/API.java +++ b/src/main/java/com/andrew121410/mc/world16essentials/utils/API.java @@ -94,9 +94,10 @@ public UnlinkedWorldLocation getLocationFromFile(CustomYmlManager customYmlManag if (locationObject instanceof UnlinkedWorldLocation) { return (UnlinkedWorldLocation) locationObject; } else if (locationObject instanceof Location location) { - setLocationToFile(customYmlManager, path, new UnlinkedWorldLocation(location)); + UnlinkedWorldLocation unlinkedWorldLocation = new UnlinkedWorldLocation(location); + setLocationToFile(customYmlManager, path, unlinkedWorldLocation); this.plugin.getLogger().info("getLocationFromFile: Converted Location to UnlinkedWorldLocation."); - return new UnlinkedWorldLocation(location); + return unlinkedWorldLocation; } return null; }