diff --git a/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java b/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java index 215eaf37c..e2f6a047e 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/util/UUIDHandlerImplementation.java @@ -134,6 +134,26 @@ public abstract class UUIDHandlerImplementation { } } }); + } else if (Settings.UUID.FORCE_LOWERCASE && !this.unknown.isEmpty() && !name.value.equals(name.value.toLowerCase())) { + TaskManager.runTaskAsync(new Runnable() { + @Override + public void run() { + UUID offlineUpper = UUID.nameUUIDFromBytes(("OfflinePlayer:" + name.value).getBytes(Charsets.UTF_8)); + if (UUIDHandlerImplementation.this.unknown.contains(offlineUpper) && offlineUpper != null && !offlineUpper.equals(uuid)) { + UUIDHandlerImplementation.this.unknown.remove(offlineUpper); + Set plots = PS.get().getPlotsAbs(offlineUpper); + if (!plots.isEmpty()) { + for (Plot plot : plots) { + plot.owner = uuid; + } + DBFunc.replaceUUID(offlineUpper, uuid); + PS.debug("&cDetected invalid UUID stored for: " + name.value); + PS.debug("&7 - Did you recently switch to online-mode storage without running `uuidconvert`?"); + PS.debug("&6PlotSquared will update incorrect entries when the user logs in, or you can reconstruct your database."); + } + } + } + }); } try { UUID offline = this.uuidMap.put(name, uuid);