Skip to content

Commit

Permalink
No need to create UnlinkedWorldLocation instance 2 times.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew121410 committed Dec 1, 2024
1 parent 11a28f7 commit f515873
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f515873

Please sign in to comment.