Skip to content

Commit e5c2270

Browse files
committed
Initial commit
0 parents  commit e5c2270

File tree

15 files changed

+813
-0
lines changed

15 files changed

+813
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Java source files
2+
*.class
3+
MANIFEST.MF
4+
*.jar
5+
*.war
6+
*.ear
7+
hs_err_pid*
8+
9+
# Mac
10+
.DS_Store
11+
12+
# Intellij
13+
*.iml
14+
*.java___jb_tmp___
15+
.idea/*
16+
*.ipr
17+
*.iws
18+
/out/
19+
.idea_modules/
20+
atlassian-ide-plugin.xml
21+
com_crashlytics_export_strings.xml
22+
crashlytics.properties
23+
crashlytics-build.properties
24+
25+
# Eclipse
26+
*.pydevproject
27+
.metadata
28+
.gradle
29+
bin/
30+
tmp/
31+
*.tmp
32+
*.bak
33+
*.swp
34+
*~.nib
35+
local.properties
36+
.settings/
37+
.loadpath
38+
.project
39+
.externalToolBuilders/
40+
*.launch
41+
.cproject
42+
.classpath
43+
.buildpath
44+
.target
45+
.texlipse
46+
47+
# Maven
48+
target/
49+
pom.xml.tag
50+
pom.xml.releaseBackup
51+
pom.xml.versionsBackup
52+
pom.xml.next
53+
release.properties
54+
dependency-reduced-pom.xml
55+
buildNumber.properties
56+
57+
# NetBeans
58+
nbproject/private/
59+
build/
60+
nbbuild/
61+
dist/
62+
nbdist/
63+
nbactions.xml
64+
nb-configuration.xml
65+
.nb-gradle/
66+
67+
# Git
68+
!.gitignore

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License
2+
3+
Copyright (c) 2010-2018 CodeMC https://github.com/CodeMC/WorldGuardWrapper
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

api/pom.xml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>org.codemc.worldguardwrapper</groupId>
9+
<artifactId>worldguardwrapper-parent</artifactId>
10+
<version>1.0.0-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>worldguardwrapper-api</artifactId>
14+
15+
<name>WorldGuardWrapper-API</name>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>${project.groupId}</groupId>
20+
<artifactId>worldguardwrapper-implementation-aggregated</artifactId>
21+
<version>${project.version}</version>
22+
<type>pom</type>
23+
</dependency>
24+
</dependencies>
25+
26+
<build>
27+
<plugins>
28+
<plugin>
29+
<groupId>org.apache.maven.plugins</groupId>
30+
<artifactId>maven-shade-plugin</artifactId>
31+
<executions>
32+
<execution>
33+
<phase>package</phase>
34+
<goals>
35+
<goal>shade</goal>
36+
</goals>
37+
</execution>
38+
</executions>
39+
</plugin>
40+
</plugins>
41+
</build>
42+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package org.codemc.worldguardwrapper;
2+
3+
import lombok.experimental.Delegate;
4+
import org.codemc.worldguardwrapper.implementation.IWorldGuardImplementation;
5+
6+
public class WorldGuardWrapper implements IWorldGuardImplementation {
7+
8+
@Delegate
9+
private IWorldGuardImplementation implementation;
10+
11+
public WorldGuardWrapper() {
12+
// TODO: better way to detect version
13+
try {
14+
Class.forName("com.sk89q.worldguard.WorldGuard");
15+
implementation = new org.codemc.worldguardwrapper.implementation.v7.WorldGuardImplementation();
16+
} catch (ClassNotFoundException e) {
17+
implementation = new org.codemc.worldguardwrapper.implementation.v6.WorldGuardImplementation();
18+
}
19+
}
20+
}

implementation/aggregated/pom.xml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>org.codemc.worldguardwrapper</groupId>
9+
<artifactId>worldguardwrapper-implementation</artifactId>
10+
<version>1.0.0-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>worldguardwrapper-implementation-aggregated</artifactId>
14+
<packaging>pom</packaging>
15+
16+
<name>WorldGuardWrapper-Implementation-Aggregated</name>
17+
18+
<dependencies>
19+
<dependency>
20+
<groupId>${project.groupId}</groupId>
21+
<artifactId>worldguardwrapper-implementation-v6</artifactId>
22+
<version>${project.version}</version>
23+
</dependency>
24+
<dependency>
25+
<groupId>${project.groupId}</groupId>
26+
<artifactId>worldguardwrapper-implementation-v7</artifactId>
27+
<version>${project.version}</version>
28+
</dependency>
29+
</dependencies>
30+
</project>

implementation/interface/pom.xml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>org.codemc.worldguardwrapper</groupId>
9+
<artifactId>worldguardwrapper-implementation</artifactId>
10+
<version>1.0.0-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>worldguardwrapper-implementation-interface</artifactId>
14+
15+
<name>WorldGuardWrapper-Implementation-Interface</name>
16+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package org.codemc.worldguardwrapper.implementation;
2+
3+
public abstract class AbstractWorldGuardImplementation implements IWorldGuardImplementation {
4+
5+
protected AbstractWorldGuardImplementation() {
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package org.codemc.worldguardwrapper.implementation;
2+
3+
import lombok.NonNull;
4+
import org.bukkit.Location;
5+
import org.bukkit.entity.Player;
6+
7+
import java.util.Optional;
8+
9+
public interface IWorldGuardImplementation {
10+
11+
int getApiVersion();
12+
13+
// String flag
14+
15+
Optional<String> queryStringFlag(Player player, @NonNull Location location, @NonNull String flagId);
16+
17+
boolean registerStringFlag(@NonNull String flagId, @NonNull String defaultValue);
18+
19+
// State flag
20+
21+
Optional<Boolean> queryStateFlag(Player player, @NonNull Location location, @NonNull String flagId);
22+
23+
boolean registerStateFlag(@NonNull String flagId, @NonNull Boolean defaultValue);
24+
}

implementation/pom.xml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>org.codemc.worldguardwrapper</groupId>
9+
<artifactId>worldguardwrapper-parent</artifactId>
10+
<version>1.0.0-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>worldguardwrapper-implementation</artifactId>
14+
<packaging>pom</packaging>
15+
16+
<modules>
17+
<module>interface</module>
18+
<module>v6</module>
19+
<module>v7</module>
20+
<module>aggregated</module>
21+
</modules>
22+
23+
<name>WorldGuardWrapper-Implementation</name>
24+
25+
<repositories>
26+
<repository>
27+
<id>codemc-repo</id>
28+
<url>https://repo.codemc.org/repository/maven-public/</url>
29+
</repository>
30+
<repository>
31+
<id>sk89q-repo</id>
32+
<url>http://maven.sk89q.com/repo/</url>
33+
</repository>
34+
</repositories>
35+
</project>

implementation/v6/pom.xml

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>org.codemc.worldguardwrapper</groupId>
9+
<artifactId>worldguardwrapper-implementation</artifactId>
10+
<version>1.0.0-SNAPSHOT</version>
11+
</parent>
12+
13+
<artifactId>worldguardwrapper-implementation-v6</artifactId>
14+
15+
<name>WorldGuardWrapper-Implementation-V6</name>
16+
17+
<dependencies>
18+
<dependency>
19+
<groupId>${project.groupId}</groupId>
20+
<artifactId>worldguardwrapper-implementation-interface</artifactId>
21+
<version>${project.version}</version>
22+
</dependency>
23+
<dependency>
24+
<groupId>com.sk89q.worldguard</groupId>
25+
<artifactId>worldguard-legacy</artifactId>
26+
<version>6.2</version>
27+
<scope>provided</scope>
28+
</dependency>
29+
<dependency>
30+
<groupId>com.sk89q.worldedit</groupId>
31+
<artifactId>worldedit-core</artifactId>
32+
<version>6.1.4-SNAPSHOT</version>
33+
<scope>provided</scope>
34+
<exclusions>
35+
<exclusion>
36+
<groupId>de.schlichtherle</groupId>
37+
<artifactId>truezip</artifactId>
38+
</exclusion>
39+
<exclusion>
40+
<groupId>com.google.guava</groupId>
41+
<artifactId>guava</artifactId>
42+
</exclusion>
43+
<exclusion>
44+
<groupId>rhino</groupId>
45+
<artifactId>js</artifactId>
46+
</exclusion>
47+
<exclusion>
48+
<groupId>org.yaml</groupId>
49+
<artifactId>snakeyaml</artifactId>
50+
</exclusion>
51+
<exclusion>
52+
<groupId>com.google.code.findbugs</groupId>
53+
<artifactId>jsr305</artifactId>
54+
</exclusion>
55+
<exclusion>
56+
<groupId>com.thoughtworks.paranamer</groupId>
57+
<artifactId>paranamer</artifactId>
58+
</exclusion>
59+
<exclusion>
60+
<groupId>com.google.code.gson</groupId>
61+
<artifactId>gson</artifactId>
62+
</exclusion>
63+
<exclusion>
64+
<groupId>com.sk89q.lib</groupId>
65+
<artifactId>jlibnoise</artifactId>
66+
</exclusion>
67+
<exclusion>
68+
<groupId>com.sk89q</groupId>
69+
<artifactId>jchronic</artifactId>
70+
</exclusion>
71+
</exclusions>
72+
</dependency>
73+
</dependencies>
74+
</project>

0 commit comments

Comments
 (0)