Merge pull request #2754 from IntellectualSites/features/v5/owners

Remove all direct access to Plot.owner
This commit is contained in:
Alexander Söderberg
2020-04-10 19:52:41 +02:00
committed by GitHub
14 changed files with 200 additions and 159 deletions

View File

@ -256,9 +256,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();
@ -275,9 +275,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()),