Merge branch 'v6' into feature/v6/pipeline-queue

This commit is contained in:
dordsor21 2020-07-24 13:03:42 +01:00
commit cf13f13fbf
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
3 changed files with 9 additions and 3 deletions

View File

@ -95,6 +95,7 @@ public class BukkitPlayer extends PlotPlayer<Player> {
super(plotAreaManager, eventDispatcher, econHandler, permissionHandler); super(plotAreaManager, eventDispatcher, econHandler, permissionHandler);
this.player = player; this.player = player;
this.econHandler = econHandler; this.econHandler = econHandler;
this.setupPermissionProfile();
if (realPlayer) { if (realPlayer) {
super.populatePersistentMetaMap(); super.populatePersistentMetaMap();
} }

View File

@ -44,8 +44,6 @@ import com.sk89q.worldedit.regions.CuboidRegion;
import com.sk89q.worldedit.world.gamemode.GameMode; import com.sk89q.worldedit.world.gamemode.GameMode;
import com.sk89q.worldedit.world.gamemode.GameModes; import com.sk89q.worldedit.world.gamemode.GameModes;
import com.sk89q.worldedit.world.item.ItemType; import com.sk89q.worldedit.world.item.ItemType;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -67,6 +65,7 @@ public class ConsolePlayer extends PlotPlayer<Actor> {
@Nonnull final PermissionHandler permissionHandler) { @Nonnull final PermissionHandler permissionHandler) {
super(plotAreaManager, eventDispatcher, econHandler, permissionHandler); super(plotAreaManager, eventDispatcher, econHandler, permissionHandler);
this.actor = actor; this.actor = actor;
this.setupPermissionProfile();
final PlotArea[] areas = plotAreaManager.getAllPlotAreas(); final PlotArea[] areas = plotAreaManager.getAllPlotAreas();
final PlotArea area; final PlotArea area;
if (areas.length > 0) { if (areas.length > 0) {

View File

@ -100,13 +100,19 @@ public abstract class PlotPlayer<P> implements CommandCaller, OfflinePlotPlayer
private final PlotAreaManager plotAreaManager; private final PlotAreaManager plotAreaManager;
private final EventDispatcher eventDispatcher; private final EventDispatcher eventDispatcher;
private final EconHandler econHandler; private final EconHandler econHandler;
private final PermissionProfile permissionProfile; private final PermissionHandler permissionHandler;
// Delayed initialisation
private PermissionProfile permissionProfile;
public PlotPlayer(@Nonnull final PlotAreaManager plotAreaManager, @Nonnull final EventDispatcher eventDispatcher, @Nullable final EconHandler econHandler, public PlotPlayer(@Nonnull final PlotAreaManager plotAreaManager, @Nonnull final EventDispatcher eventDispatcher, @Nullable final EconHandler econHandler,
@Nonnull final PermissionHandler permissionHandler) { @Nonnull final PermissionHandler permissionHandler) {
this.plotAreaManager = plotAreaManager; this.plotAreaManager = plotAreaManager;
this.eventDispatcher = eventDispatcher; this.eventDispatcher = eventDispatcher;
this.econHandler = econHandler; this.econHandler = econHandler;
this.permissionHandler = permissionHandler;
}
protected void setupPermissionProfile() {
this.permissionProfile = permissionHandler.getPermissionProfile(this).orElse( this.permissionProfile = permissionHandler.getPermissionProfile(this).orElse(
NullPermissionProfile.INSTANCE); NullPermissionProfile.INSTANCE);
} }