Modifications to formatting and UUID Handler

Fixes #2423
This commit is contained in:
MattBDev
2019-08-06 20:35:36 -04:00
parent 539ad9f05c
commit 8f685b754a
40 changed files with 546 additions and 708 deletions

View File

@ -223,8 +223,8 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
if (!chunk.isLoaded()) {
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
TaskManager.tasks.remove(currentIndex);
PlotSquared
.debug(Captions.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
PlotSquared.debug(Captions.PREFIX.getTranslated()
+ "&aSuccessfully processed and unloaded chunk!");
chunk.unload(true);
return;
}
@ -232,8 +232,8 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
if (tiles.length == 0) {
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
TaskManager.tasks.remove(currentIndex);
PlotSquared
.debug(Captions.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
PlotSquared.debug(Captions.PREFIX.getTranslated()
+ "&aSuccessfully processed and unloaded chunk!");
chunk.unload(true);
return;
}
@ -243,8 +243,8 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
if (i >= tiles.length) {
Bukkit.getScheduler().cancelTask(TaskManager.tasks.get(currentIndex));
TaskManager.tasks.remove(currentIndex);
PlotSquared.debug(
Captions.PREFIX.s() + "&aSuccessfully processed and unloaded chunk!");
PlotSquared.debug(Captions.PREFIX.getTranslated()
+ "&aSuccessfully processed and unloaded chunk!");
chunk.unload(true);
return;
}
@ -268,13 +268,15 @@ import static com.github.intellectualsites.plotsquared.plot.util.ReflectionUtils
}
}
PlotSquared.debug(
Captions.PREFIX.s() + "&a detected unsafe chunk and processed: " + (chunk.getX()
Captions.PREFIX.getTranslated() + "&a detected unsafe chunk and processed: " + (
chunk.getX()
<< 4) + "," + (chunk.getX() << 4));
}
if (tiles.length > Settings.Chunk_Processor.MAX_TILES) {
if (unload) {
PlotSquared.debug(
Captions.PREFIX.s() + "&c detected unsafe chunk: " + (chunk.getX() << 4) + ","
Captions.PREFIX.getTranslated() + "&c detected unsafe chunk: " + (chunk.getX()
<< 4) + ","
+ (chunk.getX() << 4));
cleanChunk(chunk);
return true;

View File

@ -637,7 +637,7 @@ import java.util.regex.Pattern;
EventUtil.manager.doJoinTask(pp);
}, 20);
if (pp.hasPermission(Captions.PERMISSION_ADMIN_UPDATE_NOTIFICATION.s())
if (pp.hasPermission(Captions.PERMISSION_ADMIN_UPDATE_NOTIFICATION.getTranslated())
&& PlotSquared.get().getUpdateUtility() != null) {
final UpdateUtility updateUtility = PlotSquared.get().getUpdateUtility();
final BukkitMain bukkitMain = BukkitMain.getPlugin(BukkitMain.class);
@ -941,7 +941,7 @@ import java.util.regex.Pattern;
}
event.setCancelled(true);
String message = event.getMessage();
String format = Captions.PLOT_CHAT_FORMAT.s();
String format = Captions.PLOT_CHAT_FORMAT.getTranslated();
String sender = event.getPlayer().getDisplayName();
PlotId id = plot.getId();
Set<Player> recipients = event.getRecipients();
@ -968,8 +968,8 @@ import java.util.regex.Pattern;
receiver.sendMessage(full);
}
if (!spies.isEmpty()) {
String spyMessage =
Captions.PLOT_CHAT_SPY_FORMAT.s().replace("%plot_id%", id.x + ";" + id.y)
String spyMessage = Captions.PLOT_CHAT_SPY_FORMAT.getTranslated()
.replace("%plot_id%", id.x + ";" + id.y)
.replace("%sender%", sender).replace("%msg%", message);
for (Player player : spies) {
player.sendMessage(spyMessage);
@ -1001,7 +1001,7 @@ import java.util.regex.Pattern;
&& !Permissions
.hasPermission(plotPlayer, Captions.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
event.setCancelled(true);
MainUtil.sendMessage(plotPlayer, Captions.HEIGHT_LIMIT.s()
MainUtil.sendMessage(plotPlayer, Captions.HEIGHT_LIMIT.getTranslated()
.replace("{limit}", String.valueOf(area.MAX_BUILD_HEIGHT)));
}
if (!plot.hasOwner()) {
@ -2991,7 +2991,7 @@ import java.util.regex.Pattern;
if ((location.getY() > area.MAX_BUILD_HEIGHT || location.getY() < area.MIN_BUILD_HEIGHT)
&& !Permissions.hasPermission(pp, Captions.PERMISSION_ADMIN_BUILD_HEIGHT_LIMIT)) {
event.setCancelled(true);
MainUtil.sendMessage(pp, Captions.HEIGHT_LIMIT.s()
MainUtil.sendMessage(pp, Captions.HEIGHT_LIMIT.getTranslated()
.replace("{limit}", String.valueOf(area.MAX_BUILD_HEIGHT)));
}
if (!plot.hasOwner()) {

View File

@ -112,15 +112,15 @@ public class BukkitPlayer extends PlotPlayer {
}
@Override public int hasPermissionRange(final String stub, final int range) {
if (hasPermission(Captions.PERMISSION_ADMIN.s())) {
if (hasPermission(Captions.PERMISSION_ADMIN.getTranslated())) {
return Integer.MAX_VALUE;
}
final String[] nodes = stub.split("\\.");
final StringBuilder n = new StringBuilder();
for (int i = 0; i < (nodes.length - 1); i++) {
n.append(nodes[i]).append(".");
if (!stub.equals(n + Captions.PERMISSION_STAR.s())) {
if (hasPermission(n + Captions.PERMISSION_STAR.s())) {
if (!stub.equals(n + Captions.PERMISSION_STAR.getTranslated())) {
if (hasPermission(n + Captions.PERMISSION_STAR.getTranslated())) {
return Integer.MAX_VALUE;
}
}

View File

@ -218,6 +218,13 @@ public class FileUUIDHandler extends UUIDHandlerImplementation {
StringWrapper wrap = new StringWrapper(name);
if (!toAdd.containsKey(wrap)) {
UUID uuid = FileUUIDHandler.this.uuidWrapper.getUUID(offlinePlotPlayer);
if (toAdd.containsValue(uuid)) {
StringWrapper duplicate = toAdd.inverse().get(uuid);
PlotSquared.debug(
"The UUID: " + uuid.toString() + " is already mapped to "
+ duplicate
+ "\n It cannot be added to the Map with a key of " + wrap);
}
toAdd.putIfAbsent(wrap, uuid);
if (ExpireManager.IMP != null) {
ExpireManager.IMP.storeDate(uuid, last);