mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 13:16:45 +01:00
Merge branch 'v6' into feature/v6/pipeline-queue
This commit is contained in:
commit
cf13f13fbf
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user