diff --git a/api/src/main/java/org/codemc/worldguardwrapper/region/IWrappedRegion.java b/api/src/main/java/org/codemc/worldguardwrapper/region/IWrappedRegion.java
index fbd10fd..3ee804b 100644
--- a/api/src/main/java/org/codemc/worldguardwrapper/region/IWrappedRegion.java
+++ b/api/src/main/java/org/codemc/worldguardwrapper/region/IWrappedRegion.java
@@ -23,10 +23,13 @@ public interface IWrappedRegion {
void setPriority(int priority);
+ void setParent(IWrappedRegion parent);
+
IWrappedDomain getOwners();
IWrappedDomain getMembers();
boolean contains(Location location);
+ Object convertToRegion();
}
diff --git a/implementation/legacy/src/main/java/org/codemc/worldguardwrapper/implementation/legacy/region/WrappedRegion.java b/implementation/legacy/src/main/java/org/codemc/worldguardwrapper/implementation/legacy/region/WrappedRegion.java
index 9347a70..266aafa 100644
--- a/implementation/legacy/src/main/java/org/codemc/worldguardwrapper/implementation/legacy/region/WrappedRegion.java
+++ b/implementation/legacy/src/main/java/org/codemc/worldguardwrapper/implementation/legacy/region/WrappedRegion.java
@@ -116,6 +116,14 @@ public class WrappedRegion implements IWrappedRegion {
handle.setPriority(priority);
}
+ @Override
+ public void setParent(IWrappedRegion parent) {
+ ProtectedRegion parentRegion = (ProtectedRegion) parent.convertToRegion();
+ try {
+ handle.setParent(parentRegion);
+ } catch (ProtectedRegion.CircularInheritanceException ignored) {/* Circular inheritance is detected */}
+ }
+
@Override
public IWrappedDomain getOwners() {
return new IWrappedDomain() {
@@ -191,4 +199,9 @@ public class WrappedRegion implements IWrappedRegion {
return handle.contains(WorldGuardVectorUtilities.toBlockVector(location));
}
+ @Override
+ public ProtectedRegion convertToRegion() {
+ return handle;
+ }
+
}
diff --git a/implementation/v6/src/main/java/org/codemc/worldguardwrapper/implementation/v6/region/WrappedRegion.java b/implementation/v6/src/main/java/org/codemc/worldguardwrapper/implementation/v6/region/WrappedRegion.java
index d2e8c4d..db601a1 100644
--- a/implementation/v6/src/main/java/org/codemc/worldguardwrapper/implementation/v6/region/WrappedRegion.java
+++ b/implementation/v6/src/main/java/org/codemc/worldguardwrapper/implementation/v6/region/WrappedRegion.java
@@ -112,6 +112,14 @@ public class WrappedRegion implements IWrappedRegion {
handle.setPriority(priority);
}
+ @Override
+ public void setParent(IWrappedRegion parent) {
+ ProtectedRegion parentRegion = (ProtectedRegion) parent.convertToRegion();
+ try {
+ handle.setParent(parentRegion);
+ } catch (ProtectedRegion.CircularInheritanceException ignored) {/* Circular inheritance is detected */}
+ }
+
@Override
public IWrappedDomain getOwners() {
return new IWrappedDomain() {
@@ -187,4 +195,8 @@ public class WrappedRegion implements IWrappedRegion {
return handle.contains(WorldGuardVectorUtilities.toBlockVector(location));
}
+ @Override
+ public ProtectedRegion convertToRegion() {
+ return handle;
+ }
}
diff --git a/implementation/v7/src/main/java/org/codemc/worldguardwrapper/implementation/v7/region/WrappedRegion.java b/implementation/v7/src/main/java/org/codemc/worldguardwrapper/implementation/v7/region/WrappedRegion.java
index 6540783..b15e847 100644
--- a/implementation/v7/src/main/java/org/codemc/worldguardwrapper/implementation/v7/region/WrappedRegion.java
+++ b/implementation/v7/src/main/java/org/codemc/worldguardwrapper/implementation/v7/region/WrappedRegion.java
@@ -112,6 +112,14 @@ public class WrappedRegion implements IWrappedRegion {
handle.setPriority(priority);
}
+ @Override
+ public void setParent(IWrappedRegion parent) {
+ ProtectedRegion parentRegion = (ProtectedRegion) parent.convertToRegion();
+ try {
+ handle.setParent(parentRegion);
+ } catch (ProtectedRegion.CircularInheritanceException ignored) {/* Circular inheritance is detected */}
+ }
+
@Override
public IWrappedDomain getOwners() {
return new IWrappedDomain() {
@@ -187,4 +195,8 @@ public class WrappedRegion implements IWrappedRegion {
return handle.contains(BukkitAdapter.asBlockVector(location));
}
+ @Override
+ public ProtectedRegion convertToRegion() {
+ return handle;
+ }
}
diff --git a/pom.xml b/pom.xml
index 419e485..fe8c17e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.codemc.worldguardwrapper
worldguardwrapper-parent
- 1.1.9-SNAPSHOT
+ 1.2.0-SNAPSHOT
pom
@@ -20,30 +20,10 @@
https://github.com/CodeMC/WorldGuardWrapper
2018
-
- scm:git:https://github.com/CodeMC/WorldGuardWrapper.git
- scm:git:git@github.com:CodeMC/WorldGuardWrapper.git
- https://github.com/CodeMC/WorldGuardWrapper
-
-
-
- jenkins
- http://ci.codemc.org/job/CodeMC/job/HolographicDisplays/
-
-
-
- GitHub
- https://github.com/CodeMC/WorldGuardWrapper/issues
-
-
-
- codemc-snapshots
- https://repo.codemc.org/repository/maven-snapshots/
-
- codemc-releases
- https://repo.codemc.org/repository/maven-releases/
+ iobyte-nexus
+ https://nexus.iobyte.nl/repository/maven-releases
@@ -103,16 +83,6 @@
-
- org.apache.maven.plugins
- maven-clean-plugin
- 3.1.0
-
-
- org.apache.maven.plugins
- maven-resources-plugin
- 3.1.0
-
org.apache.maven.plugins
maven-compiler-plugin
@@ -122,44 +92,46 @@
${java.version}
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 2.22.2
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 3.2.0
-
-
- org.apache.maven.plugins
- maven-javadoc-plugin
- 3.2.0
-
- public
- false
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 3.2.1
-
org.apache.maven.plugins
maven-shade-plugin
3.2.4
-
-
- org.apache.maven.plugins
- maven-install-plugin
- 2.5.2
+
+
+ shade
+ package
+
+ shade
+
+
+
org.apache.maven.plugins
maven-deploy-plugin
2.8.2
+
+ true
+
+
+
+ org.sonatype.plugins
+ nexus-staging-maven-plugin
+ 1.6.8
+
+
+ default-deploy
+ deploy
+
+ deploy
+
+
+
+
+ nexus
+ https://nexus.iobyte.nl/
+ true
+