Remove all direct access to Plot.owner

New methods were added for access to the absolute owner of a plot, and the documentation of the owner getters to clarify the purpose of the methods.
This commit is contained in:
Alexander Söderberg
2020-04-10 14:05:01 +02:00
parent 0d26111fa7
commit ce756411cf
14 changed files with 125 additions and 85 deletions

View File

@ -231,9 +231,9 @@ import java.util.UUID;
MainUtil.sendMessage(player, "&7 - Updating plot objects");
for (Plot plot : PlotSquared.get().getPlots()) {
UUID value = uCMap.get(plot.owner);
UUID value = uCMap.get(plot.getOwnerAbs());
if (value != null) {
plot.owner = value;
plot.setOwnerAbs(value);
}
plot.getTrusted().clear();
plot.getMembers().clear();
@ -250,9 +250,9 @@ import java.util.UUID;
if (!result) {
MainUtil.sendMessage(player, "&cConversion failed! Attempting recovery");
for (Plot plot : PlotSquared.get().getPlots()) {
UUID value = uCReverse.get(plot.owner);
UUID value = uCReverse.get(plot.getOwnerAbs());
if (value != null) {
plot.owner = value;
plot.setOwnerAbs(value);
}
}
DBFunc.createPlotsAndData(new ArrayList<>(PlotSquared.get().getPlots()),