Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
e9c1e3bb33
Bump worldedit-bukkit from 6.1.5 to 7.2.15
Bumps worldedit-bukkit from 6.1.5 to 7.2.15.

---
updated-dependencies:
- dependency-name: com.sk89q.worldedit:worldedit-bukkit
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-26 17:56:41 +00:00
28 changed files with 684 additions and 517 deletions

7
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

19
.github/workflows/maven.yml vendored Normal file
View File

@ -0,0 +1,19 @@
name: Java CI
on: [push]
jobs:
build_and_test:
strategy:
matrix:
jdkversion: [17]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.jdkversion }}
cache: 'maven'
- name: Build with Maven
run: mvn -V -B clean package --file pom.xml

View File

@ -1,8 +0,0 @@
group 'org.codemc.worldguardwrapper'
dependencies {
compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT'
compileOnly 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
}

17
api/pom.xml Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-parent</artifactId>
<version>1.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>worldguardwrapper-api</artifactId>
<name>WorldGuardWrapper-API</name>
</project>

View File

@ -2,13 +2,12 @@ package org.codemc.worldguardwrapper.selection;
import org.bukkit.Location; import org.bukkit.Location;
import java.util.List;
import java.util.Set; import java.util.Set;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public interface IPolygonalSelection extends ISelection { public interface IPolygonalSelection extends ISelection {
List<Location> getPoints(); Set<Location> getPoints();
int getMinimumY(); int getMinimumY();

View File

@ -5,8 +5,9 @@ import org.bukkit.Location;
import org.codemc.worldguardwrapper.selection.ICuboidSelection; import org.codemc.worldguardwrapper.selection.ICuboidSelection;
import org.codemc.worldguardwrapper.selection.IPolygonalSelection; import org.codemc.worldguardwrapper.selection.IPolygonalSelection;
import java.util.*; import java.util.Collection;
import java.util.stream.Collectors; import java.util.HashSet;
import java.util.Set;
@SuppressWarnings("unused") @SuppressWarnings("unused")
@UtilityClass @UtilityClass
@ -53,9 +54,8 @@ public class SelectionUtilities {
public IPolygonalSelection createPolygonalSelection(Collection<Location> points, int minY, int maxY) { public IPolygonalSelection createPolygonalSelection(Collection<Location> points, int minY, int maxY) {
return new IPolygonalSelection() { return new IPolygonalSelection() {
@Override @Override
public List<Location> getPoints() { public Set<Location> getPoints() {
//recoreHosting -> set to list , maintains order but remove duplicates return new HashSet<>(points);
return new ArrayList<>(points).stream().distinct().collect(Collectors.toList());
} }
@Override @Override

View File

@ -1,22 +0,0 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.0.0" apply false
}
group 'org.codemc.worldguardwrapper'
version '1.2.1-SNAPSHOT'
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
group = parent.group
version = parent.version
repositories {
mavenCentral()
maven { url "https://maven.enginehub.org/repo/" }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
}
}

View File

@ -1,7 +0,0 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

249
gradlew vendored
View File

@ -1,249 +0,0 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

92
gradlew.bat vendored
View File

@ -1,92 +0,0 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -1,5 +0,0 @@
dependencies {
api project(':implementation:v7')
api project(':implementation:v6')
api project(':implementation:legacy')
}

View File

@ -1,10 +0,0 @@
group 'org.codemc.worldguardwrapper.implementation.legacy'
dependencies {
api project(':api')
compileOnly 'org.spigotmc:spigot-api:1.12.1-R0.1-SNAPSHOT'
compileOnly 'com.sk89q:worldguard:6.1.1-SNAPSHOT'
compileOnly 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
}

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-implementation</artifactId>
<version>1.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>worldguardwrapper-implementation-legacy</artifactId>
<name>WorldGuardWrapper-Implementation-Legacy</name>
<repositories>
<repository>
<id>enginehub-repo</id>
<url>https://maven.enginehub.org/repo/</url>
<snapshots>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-api</artifactId>
<version>1.2.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldguard</artifactId>
<version>6.1</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.sk89q.spigot</groupId>
<artifactId>bukkit-classloader-check</artifactId>
</exclusion>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</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>com.sk89q</groupId>
<artifactId>jchronic</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>

View File

@ -314,9 +314,8 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
} else if (selection instanceof Polygonal2DSelection) { } else if (selection instanceof Polygonal2DSelection) {
return new IPolygonalSelection() { return new IPolygonalSelection() {
@Override @Override
public List<Location> getPoints() { public Set<Location> getPoints() {
return ((Polygonal2DSelection) selection).getNativePoints().stream() return ((Polygonal2DSelection) selection).getNativePoints().stream()
.distinct()
.map(vector -> new BlockVector(vector.toVector())) .map(vector -> new BlockVector(vector.toVector()))
.map(vector -> .map(vector ->
WorldGuardVectorUtilities.fromBlockVector( WorldGuardVectorUtilities.fromBlockVector(
@ -324,7 +323,7 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
vector vector
) )
) )
.collect(Collectors.toList()); .collect(Collectors.toSet());
} }
@Override @Override

View File

@ -46,12 +46,11 @@ public class WrappedRegion implements IWrappedRegion {
} else if (handle instanceof ProtectedPolygonalRegion) { } else if (handle instanceof ProtectedPolygonalRegion) {
return new IPolygonalSelection() { return new IPolygonalSelection() {
@Override @Override
public List<Location> getPoints() { public Set<Location> getPoints() {
return handle.getPoints().stream() return handle.getPoints().stream()
.distinct()
.map(vector -> new BlockVector(vector.toVector())) .map(vector -> new BlockVector(vector.toVector()))
.map(vector -> WorldGuardVectorUtilities.fromBlockVector(world, vector)) .map(vector -> WorldGuardVectorUtilities.fromBlockVector(world, vector))
.collect(Collectors.toList()); .collect(Collectors.toSet());
} }
@Override @Override

35
implementation/pom.xml Normal file
View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-parent</artifactId>
<version>1.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>worldguardwrapper-implementation</artifactId>
<packaging>pom</packaging>
<modules>
<module>legacy</module>
<module>v6</module>
<module>v7</module>
</modules>
<name>WorldGuardWrapper-Implementation</name>
<properties>
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
<dependencies>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,14 +0,0 @@
group 'org.codemc.worldguardwrapper.implementation.legacy'
dependencies {
api project(':api')
compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT'
compileOnly 'com.sk89q.worldguard:worldguard-legacy:6.2'
compileOnly 'com.sk89q.worldedit:worldedit-bukkit:6.1.5'
compileOnly 'com.sk89q.worldedit:worldedit-core:6.1.3-SNAPSHOT'
compileOnly 'org.javassist:javassist:3.29.2-GA'
compileOnly 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
}

92
implementation/v6/pom.xml Normal file
View File

@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-implementation</artifactId>
<version>1.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>worldguardwrapper-implementation-v6</artifactId>
<name>WorldGuardWrapper-Implementation-V6</name>
<repositories>
<repository>
<id>enginehub-repo</id>
<url>https://maven.enginehub.org/repo/</url>
<snapshots>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-api</artifactId>
<version>1.2.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-legacy</artifactId>
<version>6.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-bukkit</artifactId>
<version>7.2.15</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-core</artifactId>
<version>6.1.3-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>de.schlichtherle</groupId>
<artifactId>truezip</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
</exclusion>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</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>jchronic</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>

View File

@ -381,9 +381,8 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
} else if (selection instanceof Polygonal2DSelection) { } else if (selection instanceof Polygonal2DSelection) {
return new IPolygonalSelection() { return new IPolygonalSelection() {
@Override @Override
public List<Location> getPoints() { public Set<Location> getPoints() {
return ((Polygonal2DSelection) selection).getNativePoints().stream() return ((Polygonal2DSelection) selection).getNativePoints().stream()
.distinct()
.map(vector -> new BlockVector(vector.toVector())) .map(vector -> new BlockVector(vector.toVector()))
.map(vector -> .map(vector ->
WorldGuardVectorUtilities.fromBlockVector( WorldGuardVectorUtilities.fromBlockVector(
@ -391,7 +390,7 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
vector vector
) )
) )
.collect(Collectors.toList()); .collect(Collectors.toSet());
} }
@Override @Override

View File

@ -46,12 +46,11 @@ public class WrappedRegion implements IWrappedRegion {
} else if (handle instanceof ProtectedPolygonalRegion) { } else if (handle instanceof ProtectedPolygonalRegion) {
return new IPolygonalSelection() { return new IPolygonalSelection() {
@Override @Override
public List<Location> getPoints() { public Set<Location> getPoints() {
return handle.getPoints().stream() return handle.getPoints().stream()
.distinct()
.map(vector -> new BlockVector(vector.toVector())) .map(vector -> new BlockVector(vector.toVector()))
.map(vector -> WorldGuardVectorUtilities.fromBlockVector(world, vector)) .map(vector -> WorldGuardVectorUtilities.fromBlockVector(world, vector))
.collect(Collectors.toList()); .collect(Collectors.toSet());
} }
@Override @Override

View File

@ -1,12 +0,0 @@
group ' org.codemc.worldguardwrapper.implementation.v7'
dependencies {
api project(':api')
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.1-SNAPSHOT'
compileOnly 'org.javassist:javassist:3.29.2-GA'
compileOnly 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
}

132
implementation/v7/pom.xml Normal file
View File

@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-implementation</artifactId>
<version>1.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>worldguardwrapper-implementation-v7</artifactId>
<name>WorldGuardWrapper-Implementation-V7</name>
<repositories>
<repository>
<id>enginehub-repo</id>
<url>https://maven.enginehub.org/repo/</url>
<snapshots>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-api</artifactId>
<version>1.2.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldguard</groupId>
<artifactId>worldguard-bukkit</artifactId>
<version>7.0.8</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
</exclusion>
<exclusion>
<groupId>com.sk89q</groupId>
<artifactId>commandbook</artifactId>
</exclusion>
<exclusion>
<groupId>com.sk89q</groupId>
<artifactId>dummypermscompat</artifactId>
</exclusion>
<exclusion>
<groupId>com.sk89q.intake</groupId>
<artifactId>intake</artifactId>
</exclusion>
<exclusion>
<groupId>com.sk89q</groupId>
<artifactId>squirrelid</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>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</exclusion>
<exclusion>
<groupId>io.papermc</groupId>
<artifactId>paperlib</artifactId>
</exclusion>
<exclusion>
<groupId>com.destroystokyo.paper</groupId>
<artifactId>paper-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.bstats.bStats-Metrics</groupId>
<artifactId>bstats-bukkit</artifactId>
</exclusion>
<exclusion>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
</exclusion>
<exclusion>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
</exclusion>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
<exclusion>
<groupId>de.schlichtherle</groupId>
<artifactId>truezip</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>
</exclusions>
</dependency>
</dependencies>
</project>

View File

@ -383,12 +383,11 @@ public class WorldGuardImplementation implements IWorldGuardImplementation {
} else if (selection instanceof Polygonal2DRegion) { } else if (selection instanceof Polygonal2DRegion) {
return new IPolygonalSelection() { return new IPolygonalSelection() {
@Override @Override
public List<Location> getPoints() { public Set<Location> getPoints() {
return ((Polygonal2DRegion) selection).getPoints().stream() return ((Polygonal2DRegion) selection).getPoints().stream()
.distinct()
.map(BlockVector2::toBlockVector3) .map(BlockVector2::toBlockVector3)
.map(vector -> BukkitAdapter.adapt(world, vector)) .map(vector -> BukkitAdapter.adapt(world, vector))
.collect(Collectors.toList()); .collect(Collectors.toSet());
} }
@Override @Override

View File

@ -46,12 +46,11 @@ public class WrappedRegion implements IWrappedRegion {
} else if (handle instanceof ProtectedPolygonalRegion) { } else if (handle instanceof ProtectedPolygonalRegion) {
return new IPolygonalSelection() { return new IPolygonalSelection() {
@Override @Override
public List<Location> getPoints() { public Set<Location> getPoints() {
return handle.getPoints().stream() return handle.getPoints().stream()
.distinct()
.map(BlockVector2::toBlockVector3) .map(BlockVector2::toBlockVector3)
.map(vector -> BukkitAdapter.adapt(world, vector)) .map(vector -> BukkitAdapter.adapt(world, vector))
.collect(Collectors.toList()); .collect(Collectors.toSet());
} }
@Override @Override

View File

@ -1,65 +0,0 @@
plugins {
id 'java'
id 'com.github.johnrengelman.shadow'
id 'maven-publish'
id 'signing'
}
group 'org.codemc.worldguardwrapper'
version parent.version
assemble.dependsOn shadowJar
repositories {
mavenCentral()
maven { url "https://maven.enginehub.org/repo/" }
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
}
dependencies {
api project(':api')
api project(':implementation')
compileOnly 'org.spigotmc:spigot-api:1.8.8-R0.1-SNAPSHOT'
implementation 'org.javassist:javassist:3.29.2-GA'
compileOnly 'org.projectlombok:lombok:1.18.26'
annotationProcessor 'org.projectlombok:lombok:1.18.26'
}
shadowJar {
dependencies {
exclude(dependency('org.projectlombok:lombok'))
exclude(dependency('org.jetbrains:annotations'))
}
relocate 'javassist', 'org.codemc.worldguardwrapper.libs.javassist'
archiveFileName = "WorldGuardWrapper-${project.version}.jar"
}
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
publishing {
publications {
maven(MavenPublication) {
groupId = 'org.codemc.worldguardwrapper'
artifactId = 'worldguardwrapper'
artifact("build/libs/WorldGuardWrapper-${project.version}.jar") {
extension 'jar'
}
}
}
repositories {
maven {
name 'secure'
url = "https://repo.recorehosting.com/repository/maven-snapshots"
credentials(org.gradle.api.credentials.PasswordCredentials)
}
}
}

94
library/pom.xml Normal file
View File

@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-parent</artifactId>
<version>1.2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>worldguardwrapper</artifactId>
<name>WorldGuardWrapper-Library</name>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-api</artifactId>
<version>1.2.1-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-implementation-legacy</artifactId>
<version>1.2.1-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-implementation-v6</artifactId>
<version>1.2.1-SNAPSHOT</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>worldguardwrapper-implementation-v7</artifactId>
<version>1.2.1-SNAPSHOT</version>
<optional>true</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<configuration>
<relocations>
<relocation>
<pattern>javassist</pattern>
<shadedPattern>org.codemc.worldguardwrapper.shaded.javassist</shadedPattern>
</relocation>
</relocations>
<filters>
<!-- Ignore manifest signatures for shading the project into an uber-jar to fix -->
<!-- "Invalid signature file digest for Manifest main attributes" -->
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.RSA</exclude>
<exclude>META-INF/*.MF</exclude>
<exclude>META-INF/DEPENDENCIES</exclude>
<exclude>META-INF/**/module-info.class</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheLicenseResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
<addHeader>false</addHeader>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
</transformers>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

198
pom.xml Normal file
View File

@ -0,0 +1,198 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codemc.worldguardwrapper</groupId>
<artifactId>worldguardwrapper-parent</artifactId>
<version>1.2.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>api</module>
<module>library</module>
<module>implementation</module>
</modules>
<name>WorldGuardWrapper-Parent</name>
<description>A wrapper for the WorldGuard API that allows plugins to support both v6 and v7 APIs.</description>
<url>https://github.com/CodeMC/WorldGuardWrapper</url>
<inceptionYear>2018</inceptionYear>
<scm>
<connection>scm:git:https://github.com/CodeMC/WorldGuardWrapper.git</connection>
<developerConnection>scm:git:git@github.com:CodeMC/WorldGuardWrapper.git</developerConnection>
<url>https://github.com/CodeMC/WorldGuardWrapper</url>
</scm>
<ciManagement>
<system>jenkins</system>
<url>https://ci.codemc.io/job/CodeMC/job/WorldGuardWrapper/</url>
</ciManagement>
<issueManagement>
<system>GitHub</system>
<url>https://github.com/CodeMC/WorldGuardWrapper/issues</url>
</issueManagement>
<distributionManagement>
<snapshotRepository>
<id>codemc-snapshots</id>
<url>https://repo.codemc.org/repository/maven-snapshots/</url>
</snapshotRepository>
<repository>
<id>codemc-releases</id>
<url>https://repo.codemc.org/repository/maven-releases/</url>
</repository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spigot-api.version>1.20.1-R0.1-SNAPSHOT</spigot-api.version>
</properties>
<repositories>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>${spigot-api.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
<exclusion>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-chat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.28</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.29.2-GA</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.2</version>
<scope>provided</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
</dependencies>
<build>
<defaultGoal>clean package</defaultGoal>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<release>8</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<show>public</show>
<failOnError>false</failOnError>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.0</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.1</version>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,8 +0,0 @@
rootProject.name = 'WorldGuardWrapper'
include 'library'
include 'api'
include 'implementation'
include 'implementation:v6'
include 'implementation:v7'
include 'implementation:legacy'