From 952aaf8b43da3edf8f8c733837beccc32c95d689 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Tue, 21 Apr 2020 11:39:42 +0100 Subject: [PATCH] Fix p2 compatibility and replace empcraft.com/maven2 --- buildSrc/src/main/kotlin/CommonConfig.kt | 4 +- worldedit-bukkit/build.gradle.kts | 2 +- .../regions/plotsquared/FaweChunkManager.java | 6 +-- .../plotsquared/FaweLocalBlockQueue.java | 9 +++- .../plotsquared/FaweSchematicHandler.java | 14 +++---- .../bukkit/regions/plotsquared/FaweTrim.java | 14 +++---- .../bukkit/regions/plotsquared/MoveTo512.java | 7 ++-- .../regions/plotsquared/PlotRegionFilter.java | 6 +-- .../regions/plotsquared/PlotSetBiome.java | 33 ++++++++------- .../plotsquared/PlotSquaredFeature.java | 41 +++++++++---------- worldedit-core/build.gradle.kts | 4 +- 11 files changed, 73 insertions(+), 67 deletions(-) diff --git a/buildSrc/src/main/kotlin/CommonConfig.kt b/buildSrc/src/main/kotlin/CommonConfig.kt index df1886ac0..8751d3f42 100644 --- a/buildSrc/src/main/kotlin/CommonConfig.kt +++ b/buildSrc/src/main/kotlin/CommonConfig.kt @@ -8,10 +8,10 @@ fun Project.applyCommonConfiguration() { repositories { mavenCentral() mavenLocal() - maven { url = uri("http://ci.athion.net/job/PlotSquared-breaking/ws/mvn/") } + maven { url = uri("https://plotsquared.com/mvn/") } maven { url = uri("https://maven.sk89q.com/repo/") } maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") } - maven { url = uri("http://empcraft.com/maven2") } + maven { url = uri("https://ci.athion.net/plugin/repository/tools/") } maven { url = uri("https://repo.destroystokyo.com/repository/maven-public") } ivy { url = uri("https://ci.athion.net/job") patternLayout { diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index 07fab21be..403a55709 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -11,9 +11,9 @@ repositories { maven { url = uri("https://hub.spigotmc.org/nexus/content/groups/public") } maven { url = uri("https://repo.codemc.org/repository/maven-public") } maven { url = uri("https://papermc.io/repo/repository/maven-public/") } - maven { url = uri("http://empcraft.com/maven2") } maven { url = uri("https://maven.enginehub.org/repo/") } maven { url = uri("http://ci.emc.gs/nexus/content/groups/aikar/") } + maven { url = uri("https://ci.athion.net/plugin/repository/tools/") } maven { this.name = "JitPack" this.url = uri("https://jitpack.io") diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweChunkManager.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweChunkManager.java index 12fd0a073..b8381ea90 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweChunkManager.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweChunkManager.java @@ -4,9 +4,9 @@ import static org.bukkit.Bukkit.getWorld; import com.boydti.fawe.util.EditSessionBuilder; import com.boydti.fawe.util.TaskManager; -import com.github.intellectualsites.plotsquared.plot.object.Location; -import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; +import com.plotsquared.core.location.Location; +import com.plotsquared.core.plot.Plot; +import com.plotsquared.core.util.ChunkManager; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.MaxChangedBlocksException; import com.sk89q.worldedit.WorldEdit; diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweLocalBlockQueue.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweLocalBlockQueue.java index be0c7f8eb..977558acd 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweLocalBlockQueue.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweLocalBlockQueue.java @@ -5,7 +5,7 @@ import com.boydti.fawe.FaweAPI; import com.boydti.fawe.FaweCache; import com.boydti.fawe.beta.IQueueChunk; import com.boydti.fawe.beta.IQueueExtent; -import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; +import com.plotsquared.core.queue.LocalBlockQueue; import com.sk89q.jnbt.CompoundTag; import com.sk89q.worldedit.function.pattern.Pattern; import com.sk89q.worldedit.math.BlockVector3; @@ -21,6 +21,7 @@ public class FaweLocalBlockQueue extends LocalBlockQueue { public final IQueueExtent instance; private final World world; private BlockVector3 mutable = new MutableBlockVector3(); + private boolean setbiome = false; public FaweLocalBlockQueue(String worldName) { super(worldName); @@ -88,9 +89,15 @@ public class FaweLocalBlockQueue extends LocalBlockQueue { @Override public boolean setBiome(int x, int z, BiomeType biomeType) { + setbiome = true; return instance.setBiome(x, 0, z, biomeType); } + @Override + public boolean setBiome() { + return setbiome; + } + @Override public String getWorld() { return world.getId(); diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweSchematicHandler.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweSchematicHandler.java index bb423b84c..f8f1fe2c2 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweSchematicHandler.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweSchematicHandler.java @@ -9,12 +9,12 @@ import com.boydti.fawe.object.io.PGZIPOutputStream; import com.boydti.fawe.util.EditSessionBuilder; import com.boydti.fawe.util.IOUtil; import com.boydti.fawe.util.TaskManager; -import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.object.Location; -import com.github.intellectualsites.plotsquared.plot.object.RunnableVal; -import com.github.intellectualsites.plotsquared.plot.util.MainUtil; -import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; -import com.github.intellectualsites.plotsquared.plot.util.block.LocalBlockQueue; +import com.plotsquared.core.PlotSquared; +import com.plotsquared.core.location.Location; +import com.plotsquared.core.queue.LocalBlockQueue; +import com.plotsquared.core.util.MainUtil; +import com.plotsquared.core.util.SchematicHandler; +import com.plotsquared.core.util.task.RunnableVal; import com.sk89q.jnbt.CompoundTag; import com.sk89q.jnbt.CompressedCompoundTag; import com.sk89q.jnbt.CompressedSchematicTag; @@ -110,7 +110,7 @@ public class FaweSchematicHandler extends SchematicHandler { public void upload(final CompoundTag tag, final UUID uuid, final String file, final RunnableVal whenDone) { if (tag == null) { PlotSquared.debug("&cCannot save empty tag"); - com.github.intellectualsites.plotsquared.plot.util.TaskManager.runTask(whenDone); + com.plotsquared.core.util.task.TaskManager.runTask(whenDone); return; } CompoundTag weTag = (CompoundTag) FaweCache.IMP.asTag(tag); diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweTrim.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweTrim.java index 25041f4e8..c4ad5ae9e 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweTrim.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/FaweTrim.java @@ -1,13 +1,13 @@ package com.boydti.fawe.bukkit.regions.plotsquared; import com.boydti.fawe.util.TaskManager; -import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; -import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory; -import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; -import com.github.intellectualsites.plotsquared.plot.commands.SubCommand; -import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.util.WorldUtil; +import com.plotsquared.core.command.CommandCategory; +import com.plotsquared.core.command.CommandDeclaration; +import com.plotsquared.core.command.RequiredType; +import com.plotsquared.core.command.SubCommand; +import com.plotsquared.core.configuration.Captions; +import com.plotsquared.core.player.PlotPlayer; +import com.plotsquared.core.util.WorldUtil; @CommandDeclaration( command = "trimchunks", diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/MoveTo512.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/MoveTo512.java index a9639da1e..b3ab082e0 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/MoveTo512.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/MoveTo512.java @@ -1,8 +1,9 @@ package com.boydti.fawe.bukkit.regions.plotsquared; -import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; -import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory; -import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; + +import com.plotsquared.core.command.CommandCategory; +import com.plotsquared.core.command.CommandDeclaration; +import com.plotsquared.core.command.RequiredType; @CommandDeclaration( command = "moveto512", diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotRegionFilter.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotRegionFilter.java index 725d6f8ea..d0cfdf790 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotRegionFilter.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotRegionFilter.java @@ -3,9 +3,9 @@ package com.boydti.fawe.bukkit.regions.plotsquared; import static com.google.common.base.Preconditions.checkNotNull; import com.boydti.fawe.regions.general.CuboidRegionFilter; -import com.github.intellectualsites.plotsquared.plot.object.Location; -import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.object.PlotArea; +import com.plotsquared.core.location.Location; +import com.plotsquared.core.plot.Plot; +import com.plotsquared.core.plot.PlotArea; import com.sk89q.worldedit.math.BlockVector2; import java.util.ArrayList; diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotSetBiome.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotSetBiome.java index fe9ebea84..b0374799d 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotSetBiome.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotSetBiome.java @@ -1,22 +1,20 @@ package com.boydti.fawe.bukkit.regions.plotsquared; -import com.boydti.fawe.Fawe; -import com.boydti.fawe.FaweAPI; import com.boydti.fawe.util.EditSessionBuilder; import com.boydti.fawe.util.TaskManager; -import com.github.intellectualsites.plotsquared.commands.Command; -import com.github.intellectualsites.plotsquared.commands.CommandDeclaration; -import com.github.intellectualsites.plotsquared.plot.commands.CommandCategory; -import com.github.intellectualsites.plotsquared.plot.commands.MainCommand; -import com.github.intellectualsites.plotsquared.plot.commands.RequiredType; -import com.github.intellectualsites.plotsquared.plot.config.Captions; -import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.object.RunnableVal2; -import com.github.intellectualsites.plotsquared.plot.object.RunnableVal3; -import com.github.intellectualsites.plotsquared.plot.util.MainUtil; -import com.github.intellectualsites.plotsquared.plot.util.Permissions; -import com.github.intellectualsites.plotsquared.plot.util.StringMan; +import com.plotsquared.core.command.Command; +import com.plotsquared.core.command.CommandCategory; +import com.plotsquared.core.command.CommandDeclaration; +import com.plotsquared.core.command.MainCommand; +import com.plotsquared.core.command.RequiredType; +import com.plotsquared.core.configuration.Captions; +import com.plotsquared.core.player.PlotPlayer; +import com.plotsquared.core.plot.Plot; +import com.plotsquared.core.util.MainUtil; +import com.plotsquared.core.util.Permissions; +import com.plotsquared.core.util.StringMan; +import com.plotsquared.core.util.task.RunnableVal2; +import com.plotsquared.core.util.task.RunnableVal3; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.WorldEdit; import com.sk89q.worldedit.bukkit.BukkitAdapter; @@ -49,7 +47,8 @@ public class PlotSetBiome extends Command { @Override public CompletableFuture execute(final PlotPlayer player, String[] args, RunnableVal3 confirm, RunnableVal2 whenDone) throws CommandException { final Plot plot = check(player.getCurrentPlot(), Captions.NOT_IN_PLOT); - checkTrue(plot.isOwner(player.getUUID()) || Permissions.hasPermission(player, "plots.admin.command.generatebiome"), Captions.NO_PLOT_PERMS); + checkTrue(plot.isOwner(player.getUUID()) || Permissions + .hasPermission(player, "plots.admin.command.generatebiome"), Captions.NO_PLOT_PERMS); if (plot.getRunning() != 0) { Captions.WAIT_FOR_TIMER.send(player); return null; @@ -73,7 +72,7 @@ public class PlotSetBiome extends Command { } plot.addRunning(); TaskManager.IMP.async(() -> { - EditSession session = new EditSessionBuilder(BukkitAdapter.adapt(Bukkit.getWorld(plot.getArea().worldname))) + EditSession session = new EditSessionBuilder(BukkitAdapter.adapt(Bukkit.getWorld(plot.getArea().getWorldName()))) .autoQueue(false) .checkMemory(false) .allowedRegionsEverywhere() diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotSquaredFeature.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotSquaredFeature.java index 6afaaf5bd..daa26448f 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotSquaredFeature.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/regions/plotsquared/PlotSquaredFeature.java @@ -5,21 +5,20 @@ import com.boydti.fawe.object.RegionWrapper; import com.boydti.fawe.regions.FaweMask; import com.boydti.fawe.regions.FaweMaskManager; import com.boydti.fawe.regions.general.RegionFilter; -import com.github.intellectualsites.plotsquared.plot.PlotSquared; -import com.github.intellectualsites.plotsquared.plot.commands.MainCommand; -import com.github.intellectualsites.plotsquared.plot.config.Settings; -import com.github.intellectualsites.plotsquared.plot.database.DBFunc; -import com.github.intellectualsites.plotsquared.plot.flag.Flags; -import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotManager; -import com.github.intellectualsites.plotsquared.plot.listener.WEManager; -import com.github.intellectualsites.plotsquared.plot.object.Plot; -import com.github.intellectualsites.plotsquared.plot.object.PlotArea; -import com.github.intellectualsites.plotsquared.plot.object.PlotPlayer; -import com.github.intellectualsites.plotsquared.plot.util.ChunkManager; -import com.github.intellectualsites.plotsquared.plot.util.SchematicHandler; -import com.github.intellectualsites.plotsquared.plot.util.UUIDHandler; -import com.github.intellectualsites.plotsquared.plot.util.block.GlobalBlockQueue; -import com.github.intellectualsites.plotsquared.plot.util.block.QueueProvider; +import com.plotsquared.core.PlotSquared; +import com.plotsquared.core.command.MainCommand; +import com.plotsquared.core.configuration.Settings; +import com.plotsquared.core.database.DBFunc; +import com.plotsquared.core.generator.HybridPlotManager; +import com.plotsquared.core.player.PlotPlayer; +import com.plotsquared.core.plot.Plot; +import com.plotsquared.core.plot.PlotArea; +import com.plotsquared.core.plot.flag.implementations.DoneFlag; +import com.plotsquared.core.plot.flag.implementations.NoWorldeditFlag; +import com.plotsquared.core.util.ChunkManager; +import com.plotsquared.core.util.SchematicHandler; +import com.plotsquared.core.util.WEManager; +import com.plotsquared.core.util.uuid.UUIDHandler; import com.sk89q.worldedit.entity.Player; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.regions.CuboidRegion; @@ -97,7 +96,7 @@ public class PlotSquaredFeature extends FaweMaskManager { return false; } UUID uid = player.getUniqueId(); - return !Flags.NO_WORLDEDIT.isTrue(plot) && (plot.isOwner(uid) + return !plot.getFlag(NoWorldeditFlag.class) && (plot.isOwner(uid) || type == MaskType.MEMBER && (plot.getTrusted().contains(uid) || plot.getTrusted() .contains(DBFunc.EVERYONE) || (plot.getMembers().contains(uid) || plot.getMembers().contains(DBFunc.EVERYONE)) @@ -129,8 +128,8 @@ public class PlotSquaredFeature extends FaweMaskManager { return null; } PlotArea area = pp.getApplicablePlotArea(); - int min = area != null ? area.MIN_BUILD_HEIGHT : 0; - int max = area != null ? Math.min(255, area.MAX_BUILD_HEIGHT) : 255; + int min = area != null ? area.getMinBuildHeight() : 0; + int max = area != null ? Math.min(255, area.getMaxBuildHeight()) : 255; final HashSet faweRegions = new HashSet<>(); for (CuboidRegion current : regions) { faweRegions.add(new RegionWrapper(current.getMinimumX(), current.getMaximumX(), min, max, current.getMinimumZ(), current.getMaximumZ())); @@ -139,7 +138,7 @@ public class PlotSquaredFeature extends FaweMaskManager { final BlockVector3 pos1 = BlockVector3.at(region.getMinimumX(), min, region.getMinimumZ()); final BlockVector3 pos2 = BlockVector3.at(region.getMaximumX(), max, region.getMaximumZ()); final Plot finalPlot = plot; - if (Settings.Done.RESTRICT_BUILDING && Flags.DONE.isSet(finalPlot) || regions.isEmpty()) { + if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(finalPlot) || regions.isEmpty()) { return null; } @@ -147,7 +146,7 @@ public class PlotSquaredFeature extends FaweMaskManager { if (regions.size() == 1) { maskedRegion = new CuboidRegion(pos1, pos2); } else { - World world = FaweAPI.getWorld(area.worldname); + World world = FaweAPI.getWorld(area.getWorldName()); List weRegions = regions.stream() .map(r -> new CuboidRegion(world, BlockVector3.at(r.getMinimumX(), r.getMinimumY(), r.getMinimumZ()), BlockVector3.at(r.getMaximumX(), r.getMaximumY(), r.getMaximumZ()))) .collect(Collectors.toList()); @@ -157,7 +156,7 @@ public class PlotSquaredFeature extends FaweMaskManager { return new FaweMask(maskedRegion) { @Override public boolean isValid(Player player, MaskType type) { - if (Settings.Done.RESTRICT_BUILDING && Flags.DONE.isSet(finalPlot)) { + if (Settings.Done.RESTRICT_BUILDING && DoneFlag.isDone(finalPlot)) { return false; } return isAllowed(player, finalPlot, type); diff --git a/worldedit-core/build.gradle.kts b/worldedit-core/build.gradle.kts index 80bc5c531..3984aa78e 100644 --- a/worldedit-core/build.gradle.kts +++ b/worldedit-core/build.gradle.kts @@ -14,7 +14,7 @@ plugins { } repositories { - maven { url = uri("http://ci.athion.net/job/PlotSquared-breaking/ws/mvn/") } + maven { url = uri("https://plotsquared.com/mvn") } mavenCentral() } @@ -55,7 +55,7 @@ dependencies { "compile"("co.aikar:fastutil-lite:1.0") "compile"("com.github.luben:zstd-jni:1.4.3-1") "compileOnly"("net.fabiozumbi12:redprotect:1.9.6") - "compile"("com.github.intellectualsites.plotsquared:PlotSquared-API:latest") { + "compile"("com.plotsquared:PlotSquared:5.1") { isTransitive = false } implementation(kotlin("stdlib-jdk8", "1.3.61"))