Add support for the WorldEdit vector refactor update
- Add WorldEdit and WorldGuard module that supports the new vector system - WorldGuard/WordEdit dependencies are in the repository itself to make builds more reliable - Change code that uses WorldEdit vectors to use Spigot vectors - Rename all modules to areashop-[worldguard|worldedit]-<version> - Change maven versions of internal modules to 'latest' to be less confusing
This commit is contained in:
parent
fa4857cbce
commit
530c74ccd2
598
AreaShop/pom.xml
598
AreaShop/pom.xml
|
@ -1,292 +1,306 @@
|
|||
<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>
|
||||
<artifactId>areashop</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop</name>
|
||||
<version>2.5.0</version> <!-- Main plugin version -->
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<!-- Bukkit, AreaShop aims to support 1.7.9+ -->
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/craftbukkit-1.7.9-R0.2-SNAPSHOT.jar</systemPath>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- InteractiveMessenger library -->
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>interactivemessenger</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- BukkitDo library -->
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>bukkitdo</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Interfaces that specific WorldGuard and WorldEdit versions are built against -->
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- WorldGuard implementations -->
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-5</artifactId>
|
||||
<version>WorldGuard-5</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-6</artifactId>
|
||||
<version>WorldGuard-6</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-6_1_3</artifactId>
|
||||
<version>WorldGuard-6_1_3</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-7</artifactId>
|
||||
<version>WorldGuard-7</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- WorldEdit implementations -->
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldedit-5</artifactId>
|
||||
<version>WorldEdit-5</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldedit-6</artifactId>
|
||||
<version>WorldEdit-6</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldedit-7</artifactId>
|
||||
<version>WorldEdit-7</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- WorldEdit/WorldGuard -->
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldedit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldedit-bukkit-7.0.0-beta-01.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-legacy-7.0.0-beta01.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- Vault -->
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/VaultAPI-1.4.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- bStats -->
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<!-- Copy the jar file to a test server, activate by using -DcopyResult="/path/to/test/server" -->
|
||||
<profile>
|
||||
<id>test-locally</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>copyResult</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.8</version>
|
||||
<configuration>
|
||||
<target>
|
||||
<copy file="./target/${project.build.finalName}.jar"
|
||||
tofile="${copyResult}\${project.build.finalName}.jar"/>
|
||||
</target>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<!-- Package the source files in a jar, activate by using -Dsources -->
|
||||
<profile>
|
||||
<id>package-sources</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>sources</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<!-- Produce javadoc files, activate by using -Djavadoc -->
|
||||
<profile>
|
||||
<id>generate-javadoc</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>javadoc</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<excludePackageNames>me.wiefferink.areashop.lib</excludePackageNames>
|
||||
<destDir>${javadoc}</destDir>
|
||||
<links>
|
||||
<link>https://hub.spigotmc.org/javadocs/bukkit/</link>
|
||||
<link>http://docs.sk89q.com/worldedit/apidocs/</link>
|
||||
<link>http://docs.sk89q.com/worldguard/apidocs/</link>
|
||||
</links>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<directory>target</directory>
|
||||
<finalName>AreaShop</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>.</targetPath>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>plugin.yml</include>
|
||||
<include>config.yml</include>
|
||||
<include>hiddenConfig.yml</include>
|
||||
<include>default.yml</include>
|
||||
<include>README.md</include>
|
||||
<include>lang/*.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<relocations>
|
||||
<!-- Relocate messaging framework -->
|
||||
<relocation>
|
||||
<pattern>me.wiefferink.interactivemessenger</pattern>
|
||||
<shadedPattern>me.wiefferink.areashop.shaded.interactivemessenger</shadedPattern>
|
||||
</relocation>
|
||||
<!-- Relocate BukkitDo -->
|
||||
<relocation>
|
||||
<pattern>me.wiefferink.bukkitdo</pattern>
|
||||
<shadedPattern>me.wiefferink.areashop.shaded.bukkitdo</shadedPattern>
|
||||
</relocation>
|
||||
<!-- Relocate bstats -->
|
||||
<relocation>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>me.wiefferink.areashop.shaded.bstats</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
<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>
|
||||
<artifactId>areashop</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop</name>
|
||||
<version>2.5.0</version> <!-- Main plugin version -->
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<!-- Bukkit, AreaShop aims to support 1.7.9+ -->
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/craftbukkit-1.7.9-R0.2-SNAPSHOT.jar</systemPath>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- InteractiveMessenger library -->
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>interactivemessenger</artifactId>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- BukkitDo library -->
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>bukkitdo</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Interfaces that specific WorldGuard and WorldEdit versions are built against -->
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- WorldGuard implementations -->
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-5</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-6</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-6_1_3</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-7_beta_1</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-7_beta_2</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- WorldEdit/WorldGuard -->
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldedit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldedit-bukkit-7.0.0-beta-04.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-legacy-7.0.0-beta-02.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- WorldEdit implementations -->
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldedit-5</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldedit-6</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldedit-7_beta_1</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldedit-7_beta_4</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Vault -->
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/VaultAPI-1.4.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<!-- bStats -->
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
<version>1.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
<!-- Copy the jar file to a test server, activate by using -DcopyResult="/path/to/test/server" -->
|
||||
<profile>
|
||||
<id>test-locally</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>copyResult</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<version>1.8</version>
|
||||
<configuration>
|
||||
<target>
|
||||
<copy file="./target/${project.build.finalName}.jar"
|
||||
tofile="${copyResult}\${project.build.finalName}.jar"/>
|
||||
</target>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<!-- Package the source files in a jar, activate by using -Dsources -->
|
||||
<profile>
|
||||
<id>package-sources</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>sources</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<id>attach-sources</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
|
||||
<!-- Produce javadoc files, activate by using -Djavadoc -->
|
||||
<profile>
|
||||
<id>generate-javadoc</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>javadoc</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>2.10.4</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<id>attach-javadocs</id>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<excludePackageNames>me.wiefferink.areashop.lib</excludePackageNames>
|
||||
<destDir>${javadoc}</destDir>
|
||||
<links>
|
||||
<link>https://hub.spigotmc.org/javadocs/bukkit/</link>
|
||||
<link>http://docs.sk89q.com/worldedit/apidocs/</link>
|
||||
<link>http://docs.sk89q.com/worldguard/apidocs/</link>
|
||||
</links>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<directory>target</directory>
|
||||
<finalName>AreaShop</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>.</targetPath>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>plugin.yml</include>
|
||||
<include>config.yml</include>
|
||||
<include>hiddenConfig.yml</include>
|
||||
<include>default.yml</include>
|
||||
<include>README.md</include>
|
||||
<include>lang/*.yml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>2.4.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<relocations>
|
||||
<!-- Relocate messaging framework -->
|
||||
<relocation>
|
||||
<pattern>me.wiefferink.interactivemessenger</pattern>
|
||||
<shadedPattern>me.wiefferink.areashop.shaded.interactivemessenger</shadedPattern>
|
||||
</relocation>
|
||||
<!-- Relocate BukkitDo -->
|
||||
<relocation>
|
||||
<pattern>me.wiefferink.bukkitdo</pattern>
|
||||
<shadedPattern>me.wiefferink.areashop.shaded.bukkitdo</shadedPattern>
|
||||
</relocation>
|
||||
<!-- Relocate bstats -->
|
||||
<relocation>
|
||||
<pattern>org.bstats</pattern>
|
||||
<shadedPattern>me.wiefferink.areashop.shaded.bstats</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
|
|
@ -147,14 +147,57 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
|
|||
managers = new HashSet<>();
|
||||
boolean error = false;
|
||||
|
||||
// Check if WorldEdit is present
|
||||
String weVersion = null;
|
||||
String rawWeVersion = null;
|
||||
String weBeta = null;
|
||||
Plugin plugin = getServer().getPluginManager().getPlugin("WorldEdit");
|
||||
if(!(plugin instanceof WorldEditPlugin) || !plugin.isEnabled()) {
|
||||
error("WorldEdit plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
} else {
|
||||
worldEdit = (WorldEditPlugin)plugin;
|
||||
rawWeVersion = worldEdit.getDescription().getVersion();
|
||||
|
||||
// Find beta version
|
||||
Pattern pattern = Pattern.compile("beta-?\\d+");
|
||||
Matcher matcher = pattern.matcher(rawWeVersion);
|
||||
if (matcher.find()) {
|
||||
weBeta = matcher.group();
|
||||
}
|
||||
|
||||
// Get correct WorldEditInterface (handles things that changed version to version)
|
||||
if(worldEdit.getDescription().getVersion().startsWith("5.")) {
|
||||
weVersion = "5";
|
||||
} else if(worldEdit.getDescription().getVersion().startsWith("6.")) {
|
||||
weVersion = "6";
|
||||
} else if ("beta-01".equalsIgnoreCase(weBeta)) {
|
||||
weVersion = "7_beta_1";
|
||||
} else {
|
||||
// beta-02 and beta-03 also have the new vector system already
|
||||
weVersion = "7_beta_4";
|
||||
}
|
||||
try {
|
||||
final Class<?> clazz = Class.forName("me.wiefferink.areashop.handlers.WorldEditHandler" + weVersion);
|
||||
// Check if we have a NMSHandler class at that location.
|
||||
if(WorldEditInterface.class.isAssignableFrom(clazz)) { // Make sure it actually implements WorldEditInterface
|
||||
worldEditInterface = (WorldEditInterface)clazz.getConstructor(AreaShopInterface.class).newInstance(this); // Set our handler
|
||||
}
|
||||
} catch(final Exception e) {
|
||||
error("Could not load the handler for WorldEdit (tried to load " + weVersion + "), report this problem to the author: " + ExceptionUtils.getStackTrace(e));
|
||||
error = true;
|
||||
weVersion = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if WorldGuard is present
|
||||
String wgVersion = null;
|
||||
String rawVersion = null;
|
||||
String rawWgVersion = null;
|
||||
int major = 0;
|
||||
int minor = 0;
|
||||
int fixes = 0;
|
||||
Integer build = null;
|
||||
Plugin plugin = getServer().getPluginManager().getPlugin("WorldGuard");
|
||||
plugin = getServer().getPluginManager().getPlugin("WorldGuard");
|
||||
if(!(plugin instanceof WorldGuardPlugin) || !plugin.isEnabled()) {
|
||||
error("WorldGuard plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
|
@ -162,20 +205,20 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
|
|||
worldGuard = (WorldGuardPlugin)plugin;
|
||||
// Get correct WorldGuardInterface (handles things that changed version to version)
|
||||
try {
|
||||
rawVersion = worldGuard.getDescription().getVersion();
|
||||
if(rawVersion.contains("-SNAPSHOT;")) {
|
||||
String buildNumber = rawVersion.substring(rawVersion.indexOf("-SNAPSHOT;") + 10);
|
||||
rawWgVersion = worldGuard.getDescription().getVersion();
|
||||
if(rawWgVersion.contains("-SNAPSHOT;")) {
|
||||
String buildNumber = rawWgVersion.substring(rawWgVersion.indexOf("-SNAPSHOT;") + 10);
|
||||
if(buildNumber.contains("-")) {
|
||||
buildNumber = buildNumber.substring(0, buildNumber.indexOf("-"));
|
||||
try {
|
||||
build = Integer.parseInt(buildNumber);
|
||||
} catch(NumberFormatException e) {
|
||||
warn("Could not correctly parse the build of WorldGuard, raw version: " + rawVersion + ", buildNumber: " + buildNumber);
|
||||
warn("Could not correctly parse the build of WorldGuard, raw version: " + rawWgVersion + ", buildNumber: " + buildNumber);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Clear stuff from the version string that is not a number
|
||||
String[] versionParts = rawVersion.split("\\.");
|
||||
String[] versionParts = rawWgVersion.split("\\.");
|
||||
for(int i = 0; i < versionParts.length; i++) {
|
||||
Pattern pattern = Pattern.compile("^\\d+");
|
||||
Matcher matcher = pattern.matcher(versionParts[i]);
|
||||
|
@ -195,10 +238,11 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
|
|||
fixes = Integer.parseInt(versionParts[2]);
|
||||
}
|
||||
} catch(NumberFormatException e) {
|
||||
warn("Something went wrong while parsing WorldGuard version number: " + rawVersion);
|
||||
warn("Something went wrong while parsing WorldGuard version number: " + rawWgVersion);
|
||||
}
|
||||
|
||||
// Determine correct implementation to use
|
||||
if(worldGuard.getDescription().getVersion().startsWith("5.")) {
|
||||
if(rawWgVersion.startsWith("5.")) {
|
||||
wgVersion = "5";
|
||||
} else if(major == 6 && minor == 1 && fixes < 3) {
|
||||
wgVersion = "6";
|
||||
|
@ -211,11 +255,16 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
|
|||
} else {
|
||||
wgVersion = "6_1_3";
|
||||
}
|
||||
} else if ("beta-01".equalsIgnoreCase(weBeta)) {
|
||||
// When using WorldEdit beta-01, we need to use the WorldGuard variant with the old vector system
|
||||
wgVersion = "7_beta_1";
|
||||
} else {
|
||||
wgVersion = "7";
|
||||
// Even though the WorldGuard file is called beta-02, the reported version is still beta-01!
|
||||
wgVersion = "7_beta_2";
|
||||
}
|
||||
} catch(Exception e) { // If version detection fails, at least try to load the latest version
|
||||
wgVersion = "7";
|
||||
warn("Parsing the WorldGuard version failed, assuming version 7_beta_2:", rawWgVersion);
|
||||
wgVersion = "7_beta_2";
|
||||
}
|
||||
// Load chosen implementation
|
||||
try {
|
||||
|
@ -231,35 +280,6 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
|
|||
}
|
||||
}
|
||||
|
||||
// Check if WorldEdit is present
|
||||
String weVersion = null;
|
||||
plugin = getServer().getPluginManager().getPlugin("WorldEdit");
|
||||
if(!(plugin instanceof WorldEditPlugin) || !plugin.isEnabled()) {
|
||||
error("WorldEdit plugin is not present or has not loaded correctly");
|
||||
error = true;
|
||||
} else {
|
||||
worldEdit = (WorldEditPlugin)plugin;
|
||||
// Get correct WorldEditInterface (handles things that changed version to version)
|
||||
if(worldEdit.getDescription().getVersion().startsWith("5.")) {
|
||||
weVersion = "5";
|
||||
} else if(worldEdit.getDescription().getVersion().startsWith("6.")) {
|
||||
weVersion = "6";
|
||||
} else {
|
||||
weVersion = "7";
|
||||
}
|
||||
try {
|
||||
final Class<?> clazz = Class.forName("me.wiefferink.areashop.handlers.WorldEditHandler" + weVersion);
|
||||
// Check if we have a NMSHandler class at that location.
|
||||
if(WorldEditInterface.class.isAssignableFrom(clazz)) { // Make sure it actually implements WorldEditInterface
|
||||
worldEditInterface = (WorldEditInterface)clazz.getConstructor(AreaShopInterface.class).newInstance(this); // Set our handler
|
||||
}
|
||||
} catch(final Exception e) {
|
||||
error("Could not load the handler for WorldEdit (tried to load " + weVersion + "), report this problem to the author: " + ExceptionUtils.getStackTrace(e));
|
||||
error = true;
|
||||
weVersion = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if Vault is present
|
||||
if(getServer().getPluginManager().getPlugin("Vault") == null) {
|
||||
error("Vault plugin is not present or has not loaded correctly");
|
||||
|
@ -273,10 +293,10 @@ public final class AreaShop extends JavaPlugin implements AreaShopInterface {
|
|||
|
||||
// Print loaded version of WG and WE in debug
|
||||
if(wgVersion != null) {
|
||||
AreaShop.debug("Loaded WorldGuardHandler" + wgVersion + " (raw version: " + rawVersion + ", major:" + major + ", minor:" + minor + ", fixes:" + fixes + ", build:" + build + ")");
|
||||
AreaShop.debug("Loaded WorldGuardHandler", wgVersion, "(raw version:" + rawWgVersion + ", major:" + major + ", minor:" + minor + ", fixes:" + fixes + ", build:" + build + ")");
|
||||
}
|
||||
if(weVersion != null) {
|
||||
AreaShop.debug("Loaded WorldEditHandler" + weVersion);
|
||||
AreaShop.debug("Loaded WorldEditHandler", weVersion, "(raw version:" + rawWeVersion + ", beta:" + weBeta + ")");
|
||||
}
|
||||
|
||||
setupLanguageManager();
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package me.wiefferink.areashop.commands;
|
||||
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
|
@ -17,6 +15,7 @@ import org.bukkit.block.BlockFace;
|
|||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -104,7 +103,7 @@ public class StackCommand extends CommandAreaShop {
|
|||
plugin.message(player, "stack-unclearDirection", facing.toString().toLowerCase().replace('_', '-'));
|
||||
return;
|
||||
}
|
||||
Vector shift = new BlockVector(0, 0, 0);
|
||||
Vector shift = new Vector(0, 0, 0);
|
||||
if(facing == BlockFace.SOUTH) {
|
||||
shift = shift.setZ(-selection.getLength() - gap);
|
||||
} else if(facing == BlockFace.WEST) {
|
||||
|
@ -183,8 +182,8 @@ public class StackCommand extends CommandAreaShop {
|
|||
}
|
||||
}
|
||||
// Add the region to WorldGuard (at startposition shifted by the number of this region times the blocks it should shift)
|
||||
BlockVector minimum = new BlockVector(minimumVector.add(finalShift.multiply(current)));
|
||||
BlockVector maximum = new BlockVector(maximumVector.add(finalShift.multiply(current)));
|
||||
Vector minimum = minimumVector.clone().add(finalShift.clone().multiply(current));
|
||||
Vector maximum = maximumVector.clone().add(finalShift.clone().multiply(current));
|
||||
// Check for out of bounds
|
||||
if(minimum.getBlockY() < 0) {
|
||||
tooLow++;
|
||||
|
@ -193,7 +192,7 @@ public class StackCommand extends CommandAreaShop {
|
|||
tooHigh++;
|
||||
continue;
|
||||
}
|
||||
ProtectedCuboidRegion region = new ProtectedCuboidRegion(regionName, minimum, maximum);
|
||||
ProtectedCuboidRegion region = plugin.getWorldGuardHandler().createCuboidRegion(regionName, minimum,maximum);
|
||||
manager.addRegion(region);
|
||||
// Add the region to AreaShop
|
||||
if(rentRegions) {
|
||||
|
|
|
@ -528,12 +528,14 @@ public class TeleportFeature extends RegionFeature {
|
|||
// Calculate a default location
|
||||
if(startLocation == null) {
|
||||
// Set to block in the middle, y configured in the config
|
||||
com.sk89q.worldedit.Vector middle = com.sk89q.worldedit.Vector.getMidpoint(worldguardRegion.getMaximumPoint(), worldguardRegion.getMinimumPoint());
|
||||
Vector regionMin = AreaShop.getInstance().getWorldGuardHandler().getMinimumPoint(worldguardRegion);
|
||||
Vector regionMax = AreaShop.getInstance().getWorldGuardHandler().getMaximumPoint(worldguardRegion);
|
||||
Vector middle = regionMin.clone().midpoint(regionMax);
|
||||
String configSetting = getRegion().getStringSetting("general.teleportLocationY");
|
||||
if("bottom".equalsIgnoreCase(configSetting)) {
|
||||
middle = middle.setY(worldguardRegion.getMinimumPoint().getBlockY());
|
||||
middle = middle.setY(regionMin.getBlockY());
|
||||
} else if("top".equalsIgnoreCase(configSetting)) {
|
||||
middle = middle.setY(worldguardRegion.getMaximumPoint().getBlockY());
|
||||
middle = middle.setY(regionMax.getBlockY());
|
||||
} else if("middle".equalsIgnoreCase(configSetting)) {
|
||||
middle = middle.setY(middle.getBlockY());
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package me.wiefferink.areashop.regions;
|
||||
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedPolygonalRegion;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
|
@ -27,6 +25,7 @@ import org.bukkit.command.CommandSender;
|
|||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -514,6 +513,22 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
|||
return plugin.getRegionManager(getWorld()).getRegion(getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the minimum corner of the region.
|
||||
* @return Vector
|
||||
*/
|
||||
public Vector getMinimumPoint() {
|
||||
return plugin.getWorldGuardHandler().getMinimumPoint(getRegion());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the maximum corner of the region.
|
||||
* @return Vector
|
||||
*/
|
||||
public Vector getMaximumPoint() {
|
||||
return plugin.getWorldGuardHandler().getMaximumPoint(getRegion());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the width of the region (x-axis).
|
||||
* @return The width of the region (x-axis)
|
||||
|
@ -522,7 +537,7 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
|||
if(getRegion() == null) {
|
||||
return 0;
|
||||
}
|
||||
return getRegion().getMaximumPoint().getBlockX() - getRegion().getMinimumPoint().getBlockX() + 1;
|
||||
return getMaximumPoint().getBlockX() - getMinimumPoint().getBlockX() + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -533,7 +548,7 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
|||
if(getRegion() == null) {
|
||||
return 0;
|
||||
}
|
||||
return getRegion().getMaximumPoint().getBlockZ() - getRegion().getMinimumPoint().getBlockZ() + 1;
|
||||
return getMaximumPoint().getBlockZ() - getMinimumPoint().getBlockZ() + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -544,7 +559,7 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
|||
if(getRegion() == null) {
|
||||
return 0;
|
||||
}
|
||||
return getRegion().getMaximumPoint().getBlockY() - getRegion().getMinimumPoint().getBlockY() + 1;
|
||||
return getMaximumPoint().getBlockY() - getMinimumPoint().getBlockY() + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1495,8 +1510,8 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
|||
// Use own calculation for polygon regions, as WorldGuard does not implement it and returns 0
|
||||
ProtectedRegion region = getRegion();
|
||||
if(region instanceof ProtectedPolygonalRegion) {
|
||||
BlockVector min = region.getMinimumPoint();
|
||||
BlockVector max = region.getMaximumPoint();
|
||||
Vector min = getMinimumPoint();
|
||||
Vector max = getMaximumPoint();
|
||||
|
||||
// Exact, but slow algorithm
|
||||
if(getWidth() * getDepth() < 100) {
|
||||
|
@ -1512,7 +1527,7 @@ public abstract class GeneralRegion implements GeneralRegionInterface, Comparabl
|
|||
}
|
||||
// Estimate, but quick algorithm
|
||||
else {
|
||||
List<BlockVector2D> points = region.getPoints();
|
||||
List<Vector> points = plugin.getWorldGuardHandler().getRegionPoints(region);
|
||||
int numPoints = points.size();
|
||||
if(numPoints < 3) {
|
||||
return 0;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package me.wiefferink.areashop.tools;
|
||||
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import me.wiefferink.areashop.AreaShop;
|
||||
|
@ -21,6 +20,7 @@ import org.bukkit.configuration.Configuration;
|
|||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import javax.script.ScriptEngine;
|
||||
import javax.script.ScriptEngineManager;
|
||||
|
@ -351,8 +351,8 @@ public class Utils {
|
|||
Location selectionMin = selection.getMinimumLocation();
|
||||
Location selectionMax = selection.getMaximumLocation();
|
||||
for(ProtectedRegion region : regionManager.getRegions().values()) {
|
||||
BlockVector regionMin = region.getMinimumPoint();
|
||||
BlockVector regionMax = region.getMaximumPoint();
|
||||
Vector regionMin = AreaShop.getInstance().getWorldGuardHandler().getMinimumPoint(region);
|
||||
Vector regionMax = AreaShop.getInstance().getWorldGuardHandler().getMaximumPoint(region);
|
||||
if(
|
||||
( // x part, resolves to true if the selection and region overlap anywhere on the x-axis
|
||||
(regionMin.getBlockX() <= selectionMax.getBlockX() && regionMin.getBlockX() >= selectionMin.getBlockX())
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<artifactId>areashop-interface</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop Interface</name>
|
||||
<version>AreaShopInterface</version>
|
||||
<version>latest</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
|
@ -5,10 +5,13 @@ import com.sk89q.worldguard.protection.flags.InvalidFlagFormat;
|
|||
import com.sk89q.worldguard.protection.flags.RegionGroup;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroupFlag;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -104,4 +107,34 @@ public abstract class WorldGuardInterface {
|
|||
* @throws InvalidFlagFormat When the input for the flag is incorrect
|
||||
*/
|
||||
public abstract RegionGroup parseFlagGroupInput(RegionGroupFlag flag, String input) throws InvalidFlagFormat;
|
||||
|
||||
/**
|
||||
* Get the minimum point of a region.
|
||||
* @param region The region to get it for
|
||||
* @return Minimum point represented as vector
|
||||
*/
|
||||
public abstract Vector getMinimumPoint(ProtectedRegion region);
|
||||
|
||||
/**
|
||||
* Get the maximum point of a region.
|
||||
* @param region The region to get it for
|
||||
* @return Maximum point represented as vector
|
||||
*/
|
||||
public abstract Vector getMaximumPoint(ProtectedRegion region);
|
||||
|
||||
/**
|
||||
* Get the edges of a region (meant for polygon regions).
|
||||
* @param region The region to get it for
|
||||
* @return Points around the edge as vector array
|
||||
*/
|
||||
public abstract List<Vector> getRegionPoints(ProtectedRegion region);
|
||||
|
||||
/**
|
||||
* Create a CuboidRegion.
|
||||
* @param name Name to use in WorldEdit
|
||||
* @param min Minimum point
|
||||
* @param max Maximum point
|
||||
* @return CuboidRegion
|
||||
*/
|
||||
public abstract ProtectedCuboidRegion createCuboidRegion(String name, Vector min, Vector max);
|
||||
}
|
|
@ -1,48 +1,48 @@
|
|||
<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>
|
||||
<artifactId>areashop-worldedit-5</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldEdit 5</name>
|
||||
<version>WorldEdit-5</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/craftbukkit-1.7.9-R0.2-SNAPSHOT.jar</systemPath>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldedit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldedit-5.7-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-5.9.1-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
<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>
|
||||
<artifactId>areashop-worldedit-5</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldEdit 5</name>
|
||||
<version>latest</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/craftbukkit-1.7.9-R0.2-SNAPSHOT.jar</systemPath>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldedit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldedit-5.7-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-5.9.1-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,48 +1,48 @@
|
|||
<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>
|
||||
<artifactId>areashop-worldedit-6</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldEdit 6</name>
|
||||
<version>WorldEdit-6</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/craftbukkit-1.7.9-R0.2-SNAPSHOT.jar</systemPath>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldedit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldedit-6.0.0-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-6.0.0-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
<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>
|
||||
<artifactId>areashop-worldedit-6</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldEdit 6</name>
|
||||
<version>latest</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/craftbukkit-1.7.9-R0.2-SNAPSHOT.jar</systemPath>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldedit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldedit-6.0.0-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-6.0.0-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,10 +1,10 @@
|
|||
<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>
|
||||
<artifactId>areashop-worldedit-7</artifactId>
|
||||
<artifactId>areashop-worldedit-7_beta_1</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldEdit 7</name>
|
||||
<version>WorldEdit-7</version>
|
||||
<name>AreaShop WorldEdit 7_beta_1</name>
|
||||
<version>latest</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
|
@ -33,13 +33,13 @@
|
|||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-legacy-7.0.0-beta01.jar</systemPath>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-legacy-7.0.0-beta-01.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
|
@ -40,9 +40,9 @@ import java.lang.reflect.InvocationTargetException;
|
|||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class WorldEditHandler7 extends WorldEditInterface {
|
||||
public class WorldEditHandler7_beta_1 extends WorldEditInterface {
|
||||
|
||||
public WorldEditHandler7(AreaShopInterface pluginInterface) {
|
||||
public WorldEditHandler7_beta_1(AreaShopInterface pluginInterface) {
|
||||
super(pluginInterface);
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<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>
|
||||
<artifactId>areashop-worldedit-7_beta_4</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldEdit 7_beta_4</name>
|
||||
<version>latest</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.13-R0.1-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldedit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldedit-bukkit-7.0.0-beta-04.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-legacy-7.0.0-beta-02.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,244 @@
|
|||
package me.wiefferink.areashop.handlers;
|
||||
|
||||
import com.sk89q.worldedit.EditSession;
|
||||
import com.sk89q.worldedit.IncompleteRegionException;
|
||||
import com.sk89q.worldedit.LocalSession;
|
||||
import com.sk89q.worldedit.MaxChangedBlocksException;
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.extent.clipboard.BlockArrayClipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.Clipboard;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormat;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardReader;
|
||||
import com.sk89q.worldedit.extent.clipboard.io.ClipboardWriter;
|
||||
import com.sk89q.worldedit.extent.transform.BlockTransformExtent;
|
||||
import com.sk89q.worldedit.function.mask.Mask;
|
||||
import com.sk89q.worldedit.function.mask.Mask2D;
|
||||
import com.sk89q.worldedit.function.operation.ForwardExtentCopy;
|
||||
import com.sk89q.worldedit.function.operation.Operations;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||
import com.sk89q.worldedit.regions.Region;
|
||||
import com.sk89q.worldedit.session.ClipboardHolder;
|
||||
import com.sk89q.worldedit.util.io.Closer;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import com.sk89q.worldguard.protection.regions.RegionType;
|
||||
import me.wiefferink.areashop.interfaces.AreaShopInterface;
|
||||
import me.wiefferink.areashop.interfaces.GeneralRegionInterface;
|
||||
import me.wiefferink.areashop.interfaces.WorldEditInterface;
|
||||
import me.wiefferink.areashop.interfaces.WorldEditSelection;
|
||||
import org.apache.commons.lang.exception.ExceptionUtils;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class WorldEditHandler7_beta_4 extends WorldEditInterface {
|
||||
|
||||
public WorldEditHandler7_beta_4(AreaShopInterface pluginInterface) {
|
||||
super(pluginInterface);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldEditSelection getPlayerSelection(Player player) {
|
||||
try {
|
||||
Region region = pluginInterface.getWorldEdit().getSession(player).getSelection(BukkitAdapter.adapt(player.getWorld()));
|
||||
return new WorldEditSelection(
|
||||
player.getWorld(),
|
||||
BukkitAdapter.adapt(player.getWorld(), region.getMinimumPoint()),
|
||||
BukkitAdapter.adapt(player.getWorld(), region.getMaximumPoint())
|
||||
);
|
||||
} catch (IncompleteRegionException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean restoreRegionBlocks(File rawFile, GeneralRegionInterface regionInterface) {
|
||||
File file = null;
|
||||
ClipboardFormat format = null;
|
||||
for (ClipboardFormat formatOption : ClipboardFormats.getAll()) {
|
||||
for (String extension : formatOption.getFileExtensions()) {
|
||||
if (new File(rawFile.getAbsolutePath() + "." + extension).exists()) {
|
||||
file = new File(rawFile.getAbsolutePath() + "." + extension);
|
||||
format = formatOption;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(file == null) {
|
||||
pluginInterface.getLogger().info("Did not restore region " + regionInterface.getName() + ", schematic file does not exist: " + rawFile.getAbsolutePath());
|
||||
return false;
|
||||
}
|
||||
pluginInterface.debugI("Trying to restore region", regionInterface.getName(), "from file", file.getAbsolutePath(), "with format", format.getName());
|
||||
|
||||
com.sk89q.worldedit.world.World world = null;
|
||||
if(regionInterface.getName() != null) {
|
||||
world = BukkitAdapter.adapt(regionInterface.getWorld());
|
||||
}
|
||||
if(world == null) {
|
||||
pluginInterface.getLogger().info("Did not restore region " + regionInterface.getName() + ", world not found: " + regionInterface.getWorldName());
|
||||
return false;
|
||||
}
|
||||
EditSession editSession = pluginInterface.getWorldEdit().getWorldEdit().getEditSessionFactory().getEditSession(world, pluginInterface.getConfig().getInt("maximumBlocks"));
|
||||
editSession.enableQueue();
|
||||
ProtectedRegion region = regionInterface.getRegion();
|
||||
// Get the origin and size of the region
|
||||
BlockVector3 origin = BlockVector3.at(region.getMinimumPoint().getBlockX(), region.getMinimumPoint().getBlockY(), region.getMinimumPoint().getBlockZ());
|
||||
|
||||
// Read the schematic and paste it into the world
|
||||
try(Closer closer = Closer.create()) {
|
||||
FileInputStream fis = closer.register(new FileInputStream(file));
|
||||
BufferedInputStream bis = closer.register(new BufferedInputStream(fis));
|
||||
ClipboardReader reader = format.getReader(bis);
|
||||
|
||||
//WorldData worldData = world.getWorldData();
|
||||
LocalSession session = new LocalSession(pluginInterface.getWorldEdit().getLocalConfiguration());
|
||||
Clipboard clipboard = reader.read();
|
||||
if(clipboard.getDimensions().getY() != regionInterface.getHeight()
|
||||
|| clipboard.getDimensions().getX() != regionInterface.getWidth()
|
||||
|| clipboard.getDimensions().getZ() != regionInterface.getDepth()) {
|
||||
pluginInterface.getLogger().warning("Size of the region " + regionInterface.getName() + " is not the same as the schematic to restore!");
|
||||
pluginInterface.debugI("schematic|region, x:" + clipboard.getDimensions().getX() + "|" + regionInterface.getWidth() + ", y:" + clipboard.getDimensions().getY() + "|" + regionInterface.getHeight() + ", z:" + clipboard.getDimensions().getZ() + "|" + regionInterface.getDepth());
|
||||
}
|
||||
clipboard.setOrigin(clipboard.getMinimumPoint());
|
||||
ClipboardHolder clipboardHolder = new ClipboardHolder(clipboard);
|
||||
session.setBlockChangeLimit(pluginInterface.getConfig().getInt("maximumBlocks"));
|
||||
session.setClipboard(clipboardHolder);
|
||||
|
||||
// Build operation
|
||||
BlockTransformExtent extent = new BlockTransformExtent(clipboardHolder.getClipboard(), clipboardHolder.getTransform());
|
||||
ForwardExtentCopy copy = new ForwardExtentCopy(extent, clipboard.getRegion(), clipboard.getOrigin(), editSession, origin);
|
||||
copy.setCopyingEntities(false);
|
||||
copy.setTransform(clipboardHolder.getTransform());
|
||||
// Mask to region (for polygon and other weird shaped regions)
|
||||
// TODO make this more efficient (especially for polygon regions)
|
||||
if(region.getType() != RegionType.CUBOID) {
|
||||
copy.setSourceMask(new Mask() {
|
||||
@Override
|
||||
public boolean test(BlockVector3 vector) {
|
||||
return region.contains(vector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Mask2D toMask2D() {
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
Operations.completeLegacy(copy);
|
||||
} catch(MaxChangedBlocksException e) {
|
||||
pluginInterface.getLogger().warning("exceeded the block limit while restoring schematic of " + regionInterface.getName() + ", limit in exception: " + e.getBlockLimit() + ", limit passed by AreaShop: " + pluginInterface.getConfig().getInt("maximumBlocks"));
|
||||
return false;
|
||||
} catch(IOException e) {
|
||||
pluginInterface.getLogger().warning("An error occured while restoring schematic of " + regionInterface.getName() + ", enable debug to see the complete stacktrace");
|
||||
pluginInterface.debugI(ExceptionUtils.getStackTrace(e));
|
||||
return false;
|
||||
} catch (Exception e) {
|
||||
pluginInterface.getLogger().warning("crashed during restore of " + regionInterface.getName());
|
||||
pluginInterface.debugI(ExceptionUtils.getStackTrace(e));
|
||||
return false;
|
||||
}
|
||||
|
||||
// flushQueue is for worldedit-bukkit-7.0.0-beta-01, later versions have renamed it to flushSession
|
||||
boolean done = false;
|
||||
for (String methodName : Arrays.asList("flushSession", "flushQueue")) {
|
||||
try {
|
||||
Method method = editSession.getClass().getMethod(methodName);
|
||||
method.invoke(editSession);
|
||||
done = true;
|
||||
} catch (SecurityException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ignored) {
|
||||
// Try the next methodName
|
||||
}
|
||||
}
|
||||
|
||||
if(!done) {
|
||||
pluginInterface.getLogger().warning("Could not restore schematic of " + regionInterface.getName() + ", flushSession() failed");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveRegionBlocks(File file, GeneralRegionInterface regionInterface) {
|
||||
ClipboardFormat format = ClipboardFormats.findByAlias("sponge");
|
||||
if(format == null) {
|
||||
// Sponge format does not exist, try to select another one
|
||||
for(ClipboardFormat otherFormat : ClipboardFormats.getAll()) {
|
||||
format = otherFormat;
|
||||
}
|
||||
if(format == null) {
|
||||
pluginInterface.getLogger().warning("Cannot find a format to save a schematic in, no available formats!");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
file = new File(file.getAbsolutePath() + "." + format.getPrimaryFileExtension());
|
||||
pluginInterface.debugI("Trying to save region", regionInterface.getName(), " to file", file.getAbsolutePath(), "with format", format.getName());
|
||||
com.sk89q.worldedit.world.World world = null;
|
||||
if(regionInterface.getWorld() != null) {
|
||||
world = BukkitAdapter.adapt(regionInterface.getWorld());
|
||||
}
|
||||
if(world == null) {
|
||||
pluginInterface.getLogger().warning("Did not save region " + regionInterface.getName() + ", world not found: " + regionInterface.getWorldName());
|
||||
return false;
|
||||
}
|
||||
EditSession editSession = pluginInterface.getWorldEdit().getWorldEdit().getEditSessionFactory().getEditSession(world, pluginInterface.getConfig().getInt("maximumBlocks"));
|
||||
|
||||
// Create a clipboard
|
||||
CuboidRegion selection = new CuboidRegion(world, regionInterface.getRegion().getMinimumPoint(), regionInterface.getRegion().getMaximumPoint());
|
||||
BlockArrayClipboard clipboard = new BlockArrayClipboard(selection);
|
||||
clipboard.setOrigin(regionInterface.getRegion().getMinimumPoint());
|
||||
ForwardExtentCopy copy = new ForwardExtentCopy(editSession, new CuboidRegion(world, regionInterface.getRegion().getMinimumPoint(), regionInterface.getRegion().getMaximumPoint()), clipboard, regionInterface.getRegion().getMinimumPoint());
|
||||
try {
|
||||
Operations.completeLegacy(copy);
|
||||
} catch(MaxChangedBlocksException e) {
|
||||
pluginInterface.getLogger().warning("Exceeded the block limit while saving schematic of " + regionInterface.getName() + ", limit in exception: " + e.getBlockLimit() + ", limit passed by AreaShop: " + pluginInterface.getConfig().getInt("maximumBlocks"));
|
||||
return false;
|
||||
}
|
||||
|
||||
try(Closer closer = Closer.create()) {
|
||||
FileOutputStream fos = closer.register(new FileOutputStream(file));
|
||||
BufferedOutputStream bos = closer.register(new BufferedOutputStream(fos));
|
||||
ClipboardWriter writer = closer.register(format.getWriter(bos));
|
||||
writer.write(clipboard);
|
||||
} catch(IOException e) {
|
||||
pluginInterface.getLogger().warning("An error occured while saving schematic of " + regionInterface.getName() + ", enable debug to see the complete stacktrace");
|
||||
pluginInterface.debugI(ExceptionUtils.getStackTrace(e));
|
||||
return false;
|
||||
} catch (Exception e) {
|
||||
pluginInterface.getLogger().warning("crashed during save of " + regionInterface.getName());
|
||||
pluginInterface.debugI(ExceptionUtils.getStackTrace(e));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,41 +1,41 @@
|
|||
<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>
|
||||
<artifactId>areashop-worldguard-5</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldGuard 5</name>
|
||||
<version>WorldGuard-5</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/bukkit-1.7.9-R0.2.jar</systemPath>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-5.9.1-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
<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>
|
||||
<artifactId>areashop-worldguard-5</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldGuard 5</name>
|
||||
<version>latest</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/bukkit-1.7.9-R0.2.jar</systemPath>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-5.9.1-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,5 +1,7 @@
|
|||
package me.wiefferink.areashop.handlers;
|
||||
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.domains.DefaultDomain;
|
||||
|
@ -9,6 +11,7 @@ import com.sk89q.worldguard.protection.flags.InvalidFlagFormat;
|
|||
import com.sk89q.worldguard.protection.flags.RegionGroup;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroupFlag;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import me.wiefferink.areashop.interfaces.AreaShopInterface;
|
||||
import me.wiefferink.areashop.interfaces.RegionAccessSet;
|
||||
|
@ -18,7 +21,9 @@ import org.bukkit.Location;
|
|||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -138,4 +143,30 @@ public class WorldGuardHandler5 extends WorldGuardInterface {
|
|||
public RegionGroup parseFlagGroupInput(RegionGroupFlag flag, String input) throws InvalidFlagFormat {
|
||||
return flag.parseInput(WorldGuardPlugin.inst(), null, input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.bukkit.util.Vector getMinimumPoint(ProtectedRegion region) {
|
||||
BlockVector min = region.getMinimumPoint();
|
||||
return new org.bukkit.util.Vector(min.getX(), min.getY(), min.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.bukkit.util.Vector getMaximumPoint(ProtectedRegion region) {
|
||||
BlockVector min = region.getMaximumPoint();
|
||||
return new org.bukkit.util.Vector(min.getX(), min.getY(), min.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<org.bukkit.util.Vector> getRegionPoints(ProtectedRegion region) {
|
||||
List<org.bukkit.util.Vector> result = new ArrayList<>();
|
||||
for (BlockVector2D point : region.getPoints()) {
|
||||
result.add(new org.bukkit.util.Vector(point.getX(), 0,point.getZ()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProtectedCuboidRegion createCuboidRegion(String name, org.bukkit.util.Vector corner1, org.bukkit.util.Vector corner2) {
|
||||
return new ProtectedCuboidRegion(name, new BlockVector(corner1.getBlockX(), corner1.getBlockY(), corner1.getBlockZ()), new BlockVector(corner2.getBlockX(), corner2.getBlockY(), corner2.getBlockZ()));
|
||||
}
|
||||
}
|
|
@ -1,41 +1,41 @@
|
|||
<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>
|
||||
<artifactId>areashop-worldguard-6</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldGuard 6</name>
|
||||
<version>WorldGuard-6</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/bukkit-1.7.9-R0.2.jar</systemPath>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-6.0.0-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
<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>
|
||||
<artifactId>areashop-worldguard-6</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldGuard 6</name>
|
||||
<version>latest</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>bukkit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/bukkit-1.7.9-R0.2.jar</systemPath>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-6.0.0-SNAPSHOT.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -1,5 +1,7 @@
|
|||
package me.wiefferink.areashop.handlers;
|
||||
|
||||
import com.sk89q.worldedit.BlockVector;
|
||||
import com.sk89q.worldedit.BlockVector2D;
|
||||
import com.sk89q.worldedit.Vector;
|
||||
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
|
||||
import com.sk89q.worldguard.domains.DefaultDomain;
|
||||
|
@ -9,6 +11,7 @@ import com.sk89q.worldguard.protection.flags.InvalidFlagFormat;
|
|||
import com.sk89q.worldguard.protection.flags.RegionGroup;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroupFlag;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import me.wiefferink.areashop.interfaces.AreaShopInterface;
|
||||
import me.wiefferink.areashop.interfaces.RegionAccessSet;
|
||||
|
@ -16,7 +19,9 @@ import me.wiefferink.areashop.interfaces.WorldGuardInterface;
|
|||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
|
@ -124,4 +129,30 @@ public class WorldGuardHandler6 extends WorldGuardInterface {
|
|||
public RegionGroup parseFlagGroupInput(RegionGroupFlag flag, String input) throws InvalidFlagFormat {
|
||||
return flag.parseInput(WorldGuardPlugin.inst(), null, input);
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.bukkit.util.Vector getMinimumPoint(ProtectedRegion region) {
|
||||
BlockVector min = region.getMinimumPoint();
|
||||
return new org.bukkit.util.Vector(min.getX(), min.getY(), min.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public org.bukkit.util.Vector getMaximumPoint(ProtectedRegion region) {
|
||||
BlockVector min = region.getMaximumPoint();
|
||||
return new org.bukkit.util.Vector(min.getX(), min.getY(), min.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<org.bukkit.util.Vector> getRegionPoints(ProtectedRegion region) {
|
||||
List<org.bukkit.util.Vector> result = new ArrayList<>();
|
||||
for (BlockVector2D point : region.getPoints()) {
|
||||
result.add(new org.bukkit.util.Vector(point.getX(), 0,point.getZ()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProtectedCuboidRegion createCuboidRegion(String name, org.bukkit.util.Vector corner1, org.bukkit.util.Vector corner2) {
|
||||
return new ProtectedCuboidRegion(name, new BlockVector(corner1.getBlockX(), corner1.getBlockY(), corner1.getBlockZ()), new BlockVector(corner2.getBlockX(), corner2.getBlockY(), corner2.getBlockZ()));
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
<artifactId>areashop-worldguard-6_1_3</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldGuard 6_1_3</name>
|
||||
<version>WorldGuard-6_1_3</version>
|
||||
<version>latest</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-6</artifactId>
|
||||
<version>WorldGuard-6</version>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
@ -42,7 +42,7 @@
|
|||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>AreaShopInterface</version>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
|
@ -0,0 +1 @@
|
|||
/target
|
|
@ -0,0 +1,61 @@
|
|||
<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>
|
||||
<artifactId>areashop-worldguard-7_beta_1</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldGuard 7_beta_1</name>
|
||||
<version>latest</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.13-R0.1-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldedit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldedit-bukkit-7.0.0-beta-01.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-legacy-7.0.0-beta-01.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-6</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-6_1_3</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,40 @@
|
|||
package me.wiefferink.areashop.handlers;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.FlagContext;
|
||||
import com.sk89q.worldguard.protection.flags.Flags;
|
||||
import com.sk89q.worldguard.protection.flags.InvalidFlagFormat;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroup;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroupFlag;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import me.wiefferink.areashop.interfaces.AreaShopInterface;
|
||||
import org.bukkit.World;
|
||||
|
||||
public class WorldGuardHandler7_beta_1 extends WorldGuardHandler6_1_3 {
|
||||
|
||||
public WorldGuardHandler7_beta_1(AreaShopInterface pluginInterface) {
|
||||
super(pluginInterface);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionManager getRegionManager(World world) {
|
||||
return WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(world));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flag<?> fuzzyMatchFlag(String flagName) {
|
||||
return Flags.fuzzyMatchFlag(WorldGuard.getInstance().getFlagRegistry(), flagName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V> V parseFlagInput(Flag<V> flag, String input) throws InvalidFlagFormat {
|
||||
return flag.parseInput(FlagContext.create().setInput(input).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionGroup parseFlagGroupInput(RegionGroupFlag flag, String input) throws InvalidFlagFormat {
|
||||
return flag.parseInput(FlagContext.create().setInput(input).build());
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
/target
|
|
@ -0,0 +1,61 @@
|
|||
<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>
|
||||
<artifactId>areashop-worldguard-7_beta_2</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>AreaShop WorldGuard 7_beta_2</name>
|
||||
<version>latest</version>
|
||||
|
||||
<parent>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-parent</artifactId>
|
||||
<version>parent</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.bukkit</groupId>
|
||||
<artifactId>craftbukkit</artifactId>
|
||||
<version>1.13-R0.1-SNAPSHOT</version>
|
||||
<type>jar</type>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldedit</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldedit-bukkit-7.0.0-beta-04.jar</systemPath>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sk89q</groupId>
|
||||
<artifactId>worldguard</artifactId>
|
||||
<scope>system</scope>
|
||||
<version>any</version>
|
||||
<systemPath>${project.basedir}/../dependencies/worldguard-legacy-7.0.0-beta-02.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-6</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-worldguard-6_1_3</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.wiefferink</groupId>
|
||||
<artifactId>areashop-interface</artifactId>
|
||||
<version>latest</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,74 @@
|
|||
package me.wiefferink.areashop.handlers;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||
import com.sk89q.worldedit.math.BlockVector2;
|
||||
import com.sk89q.worldedit.math.BlockVector3;
|
||||
import com.sk89q.worldguard.WorldGuard;
|
||||
import com.sk89q.worldguard.protection.flags.Flag;
|
||||
import com.sk89q.worldguard.protection.flags.FlagContext;
|
||||
import com.sk89q.worldguard.protection.flags.Flags;
|
||||
import com.sk89q.worldguard.protection.flags.InvalidFlagFormat;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroup;
|
||||
import com.sk89q.worldguard.protection.flags.RegionGroupFlag;
|
||||
import com.sk89q.worldguard.protection.managers.RegionManager;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedCuboidRegion;
|
||||
import com.sk89q.worldguard.protection.regions.ProtectedRegion;
|
||||
import me.wiefferink.areashop.interfaces.AreaShopInterface;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class WorldGuardHandler7_beta_2 extends WorldGuardHandler6_1_3 {
|
||||
|
||||
public WorldGuardHandler7_beta_2(AreaShopInterface pluginInterface) {
|
||||
super(pluginInterface);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionManager getRegionManager(World world) {
|
||||
return WorldGuard.getInstance().getPlatform().getRegionContainer().get(BukkitAdapter.adapt(world));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Flag<?> fuzzyMatchFlag(String flagName) {
|
||||
return Flags.fuzzyMatchFlag(WorldGuard.getInstance().getFlagRegistry(), flagName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <V> V parseFlagInput(Flag<V> flag, String input) throws InvalidFlagFormat {
|
||||
return flag.parseInput(FlagContext.create().setInput(input).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public RegionGroup parseFlagGroupInput(RegionGroupFlag flag, String input) throws InvalidFlagFormat {
|
||||
return flag.parseInput(FlagContext.create().setInput(input).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector getMinimumPoint(ProtectedRegion region) {
|
||||
BlockVector3 min = region.getMinimumPoint();
|
||||
return new Vector(min.getX(), min.getY(), min.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Vector getMaximumPoint(ProtectedRegion region) {
|
||||
BlockVector3 min = region.getMaximumPoint();
|
||||
return new Vector(min.getX(), min.getY(), min.getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Vector> getRegionPoints(ProtectedRegion region) {
|
||||
List<Vector> result = new ArrayList<>();
|
||||
for (BlockVector2 point : region.getPoints()) {
|
||||
result.add(new Vector(point.getX(), 0,point.getZ()));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProtectedCuboidRegion createCuboidRegion(String name, Vector corner1, Vector corner2) {
|
||||
return new ProtectedCuboidRegion(name, BlockVector3.at(corner1.getBlockX(), corner1.getBlockY(), corner1.getBlockZ()), BlockVector3.at(corner2.getBlockX(), corner2.getBlockY(), corner2.getBlockZ()));
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
18
pom.xml
18
pom.xml
|
@ -49,14 +49,16 @@
|
|||
</properties>
|
||||
|
||||
<modules>
|
||||
<module>WorldGuard 5</module>
|
||||
<module>WorldGuard 6</module>
|
||||
<module>WorldGuard 6_1_3</module>
|
||||
<module>WorldGuard 7</module>
|
||||
<module>Interfaces</module>
|
||||
<module>WorldEdit 5</module>
|
||||
<module>WorldEdit 6</module>
|
||||
<module>WorldEdit 7</module>
|
||||
<module>areashop-interface</module>
|
||||
<module>areashop-worldguard-5</module>
|
||||
<module>areashop-worldguard-6</module>
|
||||
<module>areashop-worldguard-6_1_3</module>
|
||||
<module>areashop-worldguard-7_beta_1</module>
|
||||
<module>areashop-worldguard-7_beta_2</module>
|
||||
<module>areashop-worldedit-5</module>
|
||||
<module>areashop-worldedit-6</module>
|
||||
<module>areashop-worldedit-7_beta_1</module>
|
||||
<module>areashop-worldedit-7_beta_4</module>
|
||||
<module>AreaShop</module>
|
||||
</modules>
|
||||
|
||||
|
|
Loading…
Reference in New Issue