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

# Conflicts:
#	Bukkit/src/main/java/com/plotsquared/bukkit/BukkitPlatform.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/inject/BukkitModule.java
#	Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java
#	Core/src/main/java/com/plotsquared/core/queue/BasicLocalBlockQueue.java
This commit is contained in:
dordsor21
2020-07-24 12:21:40 +01:00
60 changed files with 2043 additions and 1044 deletions

View File

@ -51,7 +51,6 @@ import io.papermc.lib.PaperLib;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.World;
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
@ -113,25 +112,6 @@ public class BukkitUtil extends WorldUtil {
LoggerFactory.getLogger("P2/" + BukkitUtil.class.getSimpleName());
private final Collection<BlockType> tileEntityTypes = new HashSet<>();
/**
* Get a {@link PlotPlayer} from an {@link OfflinePlayer}. If the player is
* online, it returns a complete player. If the player is offline, it creates
* a fake player
*
* @param op Offline player
* @return Plot player instance
*/
@Nonnull public static PlotPlayer<Player> adapt(@Nonnull final OfflinePlayer op) {
if (op.isOnline()) {
return adapt(Objects.requireNonNull(op.getPlayer()));
}
final Player player = OfflinePlayerUtil.loadPlayer(op);
player.loadData();
return new BukkitPlayer(PlotSquared.get().getPlotAreaManager(),
PlotSquared.get().getEventDispatcher(), player, true,
PlotSquared.platform().getEconHandler());
}
/**
* Turn a Bukkit {@link Player} into a PlotSquared {@link PlotPlayer}
*
@ -213,20 +193,8 @@ public class BukkitUtil extends WorldUtil {
}
}
/**
* Gets the PlotPlayer for a UUID. The PlotPlayer is usually cached and
* will provide useful functions relating to players.
*
* @param uuid the uuid to wrap
* @return a {@code PlotPlayer}
* @see PlotPlayer#wrap(Object)
*/
@Override @Nonnull public PlotPlayer<?> getPlayer(@Nonnull final UUID uuid) {
return PlotPlayer.wrap(Bukkit.getOfflinePlayer(uuid));
}
@Override
public boolean isBlockSame(@Nonnull final BlockState block1, @Nonnull final BlockState block2) {
@Override public boolean isBlockSame(@Nonnull final BlockState block1,
@Nonnull final BlockState block2) {
if (block1.equals(block2)) {
return true;
}