mirror of
https://github.com/CodeMC/WorldGuardWrapper.git
synced 2024-11-10 13:15:19 +01:00
Use currently latest WorldEdit/WorldGuard build
When the sk89q repository is fixed, only worlguard-legacy version 7.0.0-SNAPSHOT is needed.
This commit is contained in:
parent
7efc516a14
commit
487394e256
|
@ -21,11 +21,71 @@
|
||||||
<version>1.0.3-SNAPSHOT</version>
|
<version>1.0.3-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sk89q.worldedit</groupId>
|
<groupId>com.sk89q.worldguard</groupId>
|
||||||
<artifactId>worldedit-bukkit</artifactId>
|
<artifactId>worldguard-legacy</artifactId>
|
||||||
<version>7.0.0-20181112.023924-25</version>
|
<version>7.0.0-20181117.063337-9</version> <!-- Manually set version -->
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.bukkit</groupId>
|
||||||
|
<artifactId>bukkit</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.sk89q</groupId>
|
||||||
|
<artifactId>commandbook</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency> <!-- Override worldguard-core to manually set version -->
|
||||||
|
<groupId>com.sk89q.worldguard</groupId>
|
||||||
|
<artifactId>worldguard-core</artifactId>
|
||||||
|
<version>7.0.0-20181117.063337-9</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.sk89q.intake</groupId>
|
||||||
|
<artifactId>intake</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.sk89q</groupId>
|
||||||
|
<artifactId>squirrelid</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.flywaydb</groupId>
|
||||||
|
<artifactId>flyway-core</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.khelekore</groupId>
|
||||||
|
<artifactId>prtree</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>net.sf.opencsv</groupId>
|
||||||
|
<artifactId>opencsv</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.googlecode.json-simple</groupId>
|
||||||
|
<artifactId>json-simple</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.google.code.findbugs</groupId>
|
||||||
|
<artifactId>jsr305</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency> <!-- Override worldedit-bukkit to manually set version -->
|
||||||
|
<groupId>com.sk89q.worldedit</groupId>
|
||||||
|
<artifactId>worldedit-bukkit</artifactId>
|
||||||
|
<version>7.0.0-20181118.055910-28</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.sk89q</groupId>
|
||||||
|
<artifactId>dummypermscompat</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.bukkit</groupId>
|
||||||
|
<artifactId>bukkit</artifactId>
|
||||||
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bstats</groupId>
|
<groupId>org.bstats</groupId>
|
||||||
<artifactId>bstats-bukkit</artifactId>
|
<artifactId>bstats-bukkit</artifactId>
|
||||||
|
@ -35,117 +95,21 @@
|
||||||
<artifactId>paperlib</artifactId>
|
<artifactId>paperlib</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>net.milkbowl.vault</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>VaultAPI</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.sk89q.intake</groupId>
|
<groupId>org.mockito</groupId>
|
||||||
<artifactId>intake</artifactId>
|
<artifactId>mockito-core</artifactId>
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.sk89q</groupId>
|
|
||||||
<artifactId>squirrelid</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.flywaydb</groupId>
|
|
||||||
<artifactId>flyway-core</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.khelekore</groupId>
|
|
||||||
<artifactId>prtree</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.googlecode.json-simple</groupId>
|
|
||||||
<artifactId>json-simple</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>net.sf.opencsv</groupId>
|
|
||||||
<artifactId>opencsv</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.sk89q</groupId>
|
|
||||||
<artifactId>commandbook</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>de.schlichtherle</groupId>
|
|
||||||
<artifactId>truezip</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>rhino</groupId>
|
|
||||||
<artifactId>js</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.yaml</groupId>
|
|
||||||
<artifactId>snakeyaml</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.google.guava</groupId>
|
|
||||||
<artifactId>guava</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.sk89q</groupId>
|
|
||||||
<artifactId>jchronic</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.google.code.findbugs</groupId>
|
|
||||||
<artifactId>jsr305</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.thoughtworks.paranamer</groupId>
|
|
||||||
<artifactId>paranamer</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.google.code.gson</groupId>
|
|
||||||
<artifactId>gson</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.sk89q.lib</groupId>
|
|
||||||
<artifactId>jlibnoise</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.sk89q</groupId>
|
|
||||||
<artifactId>dummypermscompat</artifactId>
|
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency> <!-- Override worldedit-core to manually set version -->
|
||||||
<groupId>com.sk89q.worldguard</groupId>
|
<groupId>com.sk89q.worldedit</groupId>
|
||||||
<artifactId>worldguard-legacy</artifactId>
|
<artifactId>worldedit-core</artifactId>
|
||||||
<version>7.0.0-SNAPSHOT</version>
|
<version>7.0.0-20181118.055910-28</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
|
||||||
<groupId>org.bukkit</groupId>
|
|
||||||
<artifactId>bukkit</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.sk89q.intake</groupId>
|
|
||||||
<artifactId>intake</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.sk89q</groupId>
|
|
||||||
<artifactId>squirrelid</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.flywaydb</groupId>
|
|
||||||
<artifactId>flyway-core</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.khelekore</groupId>
|
|
||||||
<artifactId>prtree</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.googlecode.json-simple</groupId>
|
|
||||||
<artifactId>json-simple</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>net.sf.opencsv</groupId>
|
|
||||||
<artifactId>opencsv</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>com.sk89q</groupId>
|
|
||||||
<artifactId>commandbook</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>de.schlichtherle</groupId>
|
<groupId>de.schlichtherle</groupId>
|
||||||
<artifactId>truezip</artifactId>
|
<artifactId>truezip</artifactId>
|
||||||
|
@ -183,8 +147,8 @@
|
||||||
<artifactId>jlibnoise</artifactId>
|
<artifactId>jlibnoise</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.sk89q</groupId>
|
<groupId>org.mockito</groupId>
|
||||||
<artifactId>dummypermscompat</artifactId>
|
<artifactId>mockito-core</artifactId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
package org.codemc.worldguardwrapper.implementation.v7;
|
package org.codemc.worldguardwrapper.implementation.v7;
|
||||||
|
|
||||||
import com.sk89q.worldedit.BlockVector;
|
|
||||||
import com.sk89q.worldedit.BlockVector2D;
|
|
||||||
import com.sk89q.worldedit.Vector;
|
|
||||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
import com.sk89q.worldedit.bukkit.BukkitWorld;
|
import com.sk89q.worldedit.bukkit.BukkitWorld;
|
||||||
|
import com.sk89q.worldedit.math.BlockVector2;
|
||||||
import com.sk89q.worldguard.LocalPlayer;
|
import com.sk89q.worldguard.LocalPlayer;
|
||||||
import com.sk89q.worldguard.WorldGuard;
|
import com.sk89q.worldguard.WorldGuard;
|
||||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||||
|
@ -44,22 +42,6 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
|
||||||
plugin = WorldGuardPlugin.inst();
|
plugin = WorldGuardPlugin.inst();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adapters
|
|
||||||
|
|
||||||
private static Vector toVector(Location location) {
|
|
||||||
return new Vector(location.getX(), location.getY(), location.getZ());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static BlockVector toBlockVector(Location location) {
|
|
||||||
return new BlockVector(location.getX(), location.getY(), location.getZ());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static List<BlockVector2D> toBlockVector2DList(List<Location> locations) {
|
|
||||||
return locations.stream()
|
|
||||||
.map(location -> new BlockVector2D(location.getX(), location.getZ()))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
private Optional<LocalPlayer> wrapPlayer(Player player) {
|
private Optional<LocalPlayer> wrapPlayer(Player player) {
|
||||||
return Optional.ofNullable(player).map(bukkitPlayer -> plugin.wrapPlayer(player));
|
return Optional.ofNullable(player).map(bukkitPlayer -> plugin.wrapPlayer(player));
|
||||||
}
|
}
|
||||||
|
@ -73,7 +55,7 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<ApplicableRegionSet> getApplicableRegions(@NonNull Location location) {
|
private Optional<ApplicableRegionSet> getApplicableRegions(@NonNull Location location) {
|
||||||
return getWorldManager(location.getWorld()).map(manager -> manager.getApplicableRegions(toVector(location)));
|
return getWorldManager(location.getWorld()).map(manager -> manager.getApplicableRegions(BukkitAdapter.asBlockVector(location)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private <V> Optional<V> queryValue(Player player, @NonNull Location location, @NonNull Flag<V> flag) {
|
private <V> Optional<V> queryValue(Player player, @NonNull Location location, @NonNull Flag<V> flag) {
|
||||||
|
@ -112,7 +94,7 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean contains(Location location) {
|
public boolean contains(Location location) {
|
||||||
return region.contains(toVector(location));
|
return region.contains(BukkitAdapter.asBlockVector(location));
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -226,9 +208,13 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
|
||||||
public Optional<WrappedRegion> addRegion(String id, List<Location> points, int minY, int maxY) {
|
public Optional<WrappedRegion> addRegion(String id, List<Location> points, int minY, int maxY) {
|
||||||
ProtectedRegion region;
|
ProtectedRegion region;
|
||||||
if (points.size() == 2) {
|
if (points.size() == 2) {
|
||||||
region = new ProtectedCuboidRegion(id, toBlockVector(points.get(0)), toBlockVector(points.get(1)));
|
region = new ProtectedCuboidRegion(id, BukkitAdapter.asBlockVector(points.get(0)), BukkitAdapter.asBlockVector(points.get(1)));
|
||||||
} else {
|
} else {
|
||||||
region = new ProtectedPolygonalRegion(id, toBlockVector2DList(points), minY, maxY);
|
List<BlockVector2> vectorPoints = points.stream()
|
||||||
|
.map(location -> BukkitAdapter.asBlockVector(location).toBlockVector2())
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
region = new ProtectedPolygonalRegion(id, vectorPoints, minY, maxY);
|
||||||
}
|
}
|
||||||
|
|
||||||
Optional<RegionManager> manager = getWorldManager(points.get(0).getWorld());
|
Optional<RegionManager> manager = getWorldManager(points.get(0).getWorld());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user