-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Project exclude paths | ||
/target/ | ||
/WorldGuard6/target/ | ||
/WorldGuard7/target/ | ||
/WorldGuardWrap/target/ | ||
/WorldGuardWrapPlugin/target/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?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"> | ||
<parent> | ||
<artifactId>WorldGuardWrapper</artifactId> | ||
<groupId>org.example</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<version>WG6</version> | ||
|
||
<artifactId>WorldGuard6</artifactId> | ||
<repositories> | ||
<repository> | ||
<id>papermc</id> | ||
<url>https://papermc.io/repo/repository/maven-public</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.sk89q</groupId> | ||
<artifactId>worldguard</artifactId> | ||
<version>6.1.1-SNAPSHOT</version> | ||
<scope>system</scope> | ||
<systemPath>${pom.basedir}/deps/WorldGuard6.jar</systemPath> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.sk89q</groupId> | ||
<artifactId>worldedit</artifactId> | ||
<version>5.5.6</version> | ||
<scope>system</scope> | ||
<systemPath>${pom.basedir}/deps/WorldEdit6.jar</systemPath> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.example</groupId> | ||
<artifactId>WorldGuardWrapper</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.destroystokyo.paper</groupId> | ||
<artifactId>paper-api</artifactId> | ||
<version>1.13.2-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.example</groupId> | ||
<artifactId>WorldGuardWrap</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<properties> | ||
<maven.compiler.source>8</maven.compiler.source> | ||
<maven.compiler.target>8</maven.compiler.target> | ||
</properties> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.reb4ck.regionwrapper.implementations; | ||
|
||
import com.sk89q.worldguard.bukkit.WGBukkit; | ||
import com.sk89q.worldguard.protection.ApplicableRegionSet; | ||
import com.sk89q.worldguard.protection.managers.RegionManager; | ||
import com.sk89q.worldguard.protection.regions.ProtectedRegion; | ||
import org.bukkit.Location; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
|
||
public class WorldGuard6 implements RegionPluginImpl { | ||
|
||
@Override | ||
public boolean isInRegion(Location location, List<String> regions) { | ||
Set<String> locationRegions = getRegions(location); | ||
for(String region : regions) | ||
return locationRegions.contains(region); | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isInRegion(Location location, String region) { | ||
return getRegions(location).contains(region); | ||
} | ||
|
||
@Override | ||
public Set<String> getRegions(Location location) { | ||
RegionManager regionManager = WGBukkit.getRegionManager(location.getWorld()); | ||
ApplicableRegionSet set = regionManager.getApplicableRegions(location); | ||
return set.getRegions().stream().map(ProtectedRegion::getId).collect(Collectors.toSet()); | ||
} | ||
|
||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?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"> | ||
<parent> | ||
<artifactId>WorldGuardWrapper</artifactId> | ||
<groupId>org.example</groupId> | ||
<version>1.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>WorldGuard7</artifactId> | ||
<properties> | ||
<maven.compiler.source>8</maven.compiler.source> | ||
<maven.compiler.target>8</maven.compiler.target> | ||
</properties> | ||
<repositories> | ||
<repository> | ||
<id>sk89q-repo</id> | ||
<url>https://maven.enginehub.org/repo/</url> | ||
</repository> | ||
</repositories> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.sk89q.worldguard</groupId> | ||
<artifactId>worldguard-bukkit</artifactId> | ||
<version>7.0.3</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.example</groupId> | ||
<artifactId>WorldGuardWrapper</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.example</groupId> | ||
<artifactId>WorldGuardWrap</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |