Skip to content

Commit a6f6391

Browse files
authored
Merge pull request #194 from CloudNetService/development
Update v3.2.0-RELEASE
2 parents 12e9cd2 + d772ed0 commit a6f6391

File tree

249 files changed

+9680
-3536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+9680
-3536
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ src/test
2525

2626
# various other potential build files
2727
build/
28+
out/
2829
bin/
2930
dist/
3031
manifest.mf

.template/extras/CloudNet-Signs/dytanic_config.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
{
55
"targetGroup": "Lobby",
66
"switchToSearchingWhenServiceIsFull": true,
7+
"knockbackDistance": 1.0,
8+
"knockbackStrength": 0.8,
79
"taskLayouts": [],
810
"defaultOnlineLayout": {
911
"lines": [
@@ -328,9 +330,11 @@
328330
}
329331
],
330332
"messages": {
333+
"server-connecting-message": "&7You will be send to &c%server%&7...",
331334
"command-cloudsign-remove-success": "&7The target sign will removed! Please wait...",
332-
"server-connecting-message": "&7You will send to &c%server%&7...",
333-
"command-cloudsign-create-success": "&7The target sign with the target group &6%group% &7is successfully created."
335+
"command-cloudsign-create-success": "&7The target sign with the target group &6%group% &7was successfully created.",
336+
"command-cloudsign-sign-already-exist": "&7The sign is already set. If you want to remove it, use the /cloudsign remove command",
337+
"command-cloudsign-cleanup-success": "&7Non-existing signs were removed successfully"
334338
}
335339
}
336340
}

Jenkinsfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ pipeline {
5151
sh 'rm -r temp/';
5252
}
5353
}
54-
stage('Install') {
54+
stage('Maven') {
5555
steps {
56-
echo 'Installing all artifacts to the local maven repo...';
57-
sh './gradlew install';
56+
echo 'Creating artifacts for the maven repo...';
57+
sh './gradlew sourceJar';
58+
sh './gradlew deploymentJar';
59+
sh './gradlew javadocJar';
5860
}
5961
}
6062
stage('Javadoc') {

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
- **SSL/TLS support** for security connections between the nodes in cluster or between the services and the node with or none own certificates
3333
- Multi system support and synchronizing in a network cluster
3434
- Support for Minecraft **vanilla 1.0+**
35-
- Application support for [Nukkit Project 1.0+ for Bedrock Edition 1.7](https://github.com/NukkitX/Nukkit)
35+
- Application support for [Nukkit Project for Bedrock Edition 1.7+](https://github.com/NukkitX/Nukkit)
3636
- Application support for [Bukkit based Minecraft **1.8.8+** (Spigot, PaperSpigot and more...)](https://github.com/Bukkit/Bukkit)
3737
- Application support for [Sponge based Minecraft servers with the SpongeAPI **7.0.0+**](https://www.spongepowered.org/)
3838
- Application support for [BungeeCord proxy server and forks for MC **1.8.8+**](https://github.com/SpigotMC/BungeeCord)

build.gradle

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defaultTasks 'clean', 'build', 'test', 'jar'
22

33
allprojects {
44

5-
def major = 3, minor = 1, patch = 1, versionType = "RELEASE"
5+
def major = 3, minor = 2, patch = 0, versionType = "RELEASE"
66

77
group 'de.dytanic.cloudnet'
88
version "$major.$minor.$patch-$versionType"
@@ -49,7 +49,7 @@ allprojects {
4949

5050
project.ext {
5151

52-
cloudNetCodeName = 'Tsunami'
52+
cloudNetCodeName = 'Eruption'
5353

5454
//Dependencies
5555
dependencyLombokVersion = '1.18.6'
@@ -160,6 +160,10 @@ subprojects {
160160
options.encoding = 'UTF-8'
161161
}
162162

163+
javadoc {
164+
options.encoding = 'UTF-8'
165+
}
166+
163167
sourceCompatibility = 1.8
164168
targetCompatibility = 1.8
165169

@@ -169,9 +173,7 @@ subprojects {
169173
annotationProcessor group: 'org.projectlombok', name: 'lombok', version: dependencyLombokVersion
170174
}
171175

172-
173176
task sourceJar(type: Jar, dependsOn: classes) {
174-
175177
classifier = 'sources'
176178
from sourceSets.main.allSource
177179
}
@@ -187,6 +189,12 @@ subprojects {
187189
}.writeTo("$buildDir/libs/${pro.name}-${pro.version}.pom")
188190
}
189191
}
192+
193+
task javadocJar(type: Jar, dependsOn: javadoc) {
194+
classifier = 'javadoc'
195+
from javadoc
196+
}
197+
190198
}
191199

192200
task allJavadoc(type: Javadoc) {
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package de.dytanic.cloudnet.common;
2+
3+
import java.util.Arrays;
4+
import java.util.Optional;
5+
6+
public enum JavaVersion {
7+
JAVA_8(8, 52D, "Java 8"),
8+
JAVA_9(9, 53D, "Java 9"),
9+
JAVA_10(10, 54D, "Java 10"),
10+
JAVA_11(11, 55D, "Java 11"),
11+
JAVA_12(12, 56D, "Java 12"),
12+
JAVA_13(13, 57D, "Java 13"),
13+
JAVA_14(14, 58D, "Java 14");
14+
15+
private int version;
16+
private double versionId;
17+
private String name;
18+
19+
JavaVersion(int version, double versionId, String name) {
20+
this.version = version;
21+
this.versionId = versionId;
22+
this.name = name;
23+
}
24+
25+
public int getVersion() {
26+
return this.version;
27+
}
28+
29+
public double getVersionId() {
30+
return this.versionId;
31+
}
32+
33+
public String getName() {
34+
return this.name;
35+
}
36+
37+
public boolean isSupported(JavaVersion minJavaVersion, JavaVersion maxJavaVersion) {
38+
return this.versionId >= minJavaVersion.versionId && this.versionId <= maxJavaVersion.versionId;
39+
}
40+
41+
public boolean isSupportedByMin(JavaVersion minRequiredJavaVersion) {
42+
return this.versionId >= minRequiredJavaVersion.versionId;
43+
}
44+
45+
public boolean isSupportedByMax(JavaVersion maxRequiredJavaVersion) {
46+
return this.versionId <= maxRequiredJavaVersion.versionId;
47+
}
48+
49+
public static JavaVersion getRuntimeVersion() {
50+
double versionId = Double.parseDouble(System.getProperty("java.class.version"));
51+
return fromVersionId(versionId).orElseThrow(() -> new IllegalStateException("Running on an unsupported java version " + versionId));
52+
}
53+
54+
public static Optional<JavaVersion> fromVersionId(double versionId) {
55+
return Arrays.stream(values()).filter(javaVersion -> javaVersion.versionId == versionId).findFirst();
56+
}
57+
58+
public static Optional<JavaVersion> fromVersion(int version) {
59+
return Arrays.stream(values()).filter(javaVersion -> javaVersion.version == version).findFirst();
60+
}
61+
62+
}

cloudnet-common/src/main/java/de/dytanic/cloudnet/common/collection/Iterables.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public static void forEach(Properties properties, Consumer<String> consumer) {
128128
}
129129

130130
/**
131-
* Iterates all keys in a Enumeration<T> class instance.
131+
* Iterates all keys in a Enumeration class instance.
132132
*
133133
* @param enumeration the items which should iterate
134134
* @param consumer the handler which handle the following keys
@@ -158,7 +158,7 @@ public static <T> void forEach(List<T> list, Consumer<T> consumer) {
158158
}
159159

160160
/**
161-
* Iterates all keys in a Enumeration<T> class instance.
161+
* Iterates all keys in a Enumeration class instance.
162162
*
163163
* @param enumeration the items which should iterate
164164
* @param consumer the handler which handle the following keys
@@ -190,7 +190,7 @@ public static <T> void forEach(Iterator<T> iterator, Consumer<T> consumer) {
190190
}
191191

192192
/**
193-
* Iterates all keys in a Iterator<T> class instance.
193+
* Iterates all keys in a Iterator class instance.
194194
*
195195
* @param iterator the items which should iterate
196196
* @param consumer the handler which handle the following keys
@@ -227,9 +227,6 @@ public static <T> T first(Iterable<T> iterable, Predicate<T> predicate) {
227227
return null;
228228
}
229229

230-
/**
231-
*
232-
*/
233230
public static <T> T first(T[] iterable, Predicate<T> predicate) {
234231
if (iterable == null || predicate == null) {
235232
return null;

cloudnet-common/src/main/java/de/dytanic/cloudnet/common/concurrent/ITaskListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* A listener for all tasks, that should handle the process
55
*
6-
* @param <T> the type of the listener, which should accept if the operation from the ITask<V> instance is complete
6+
* @param <T> the type of the listener, which should accept if the operation from the ITask instance is complete
77
* @see ITask
88
*/
99
public interface ITaskListener<T> {

cloudnet-common/src/main/java/de/dytanic/cloudnet/common/document/IPersistable.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package de.dytanic.cloudnet.common.document;
22

33
import java.io.*;
4+
import java.nio.file.Files;
45
import java.nio.file.Path;
56
import java.nio.file.Paths;
67

@@ -15,6 +16,14 @@ public interface IPersistable {
1516

1617

1718
default IPersistable write(Path path) {
19+
Path parent = path.getParent();
20+
if (parent != null && !Files.exists(parent)) {
21+
try {
22+
Files.createDirectories(parent);
23+
} catch (IOException exception) {
24+
exception.printStackTrace();
25+
}
26+
}
1827
try (OutputStream outputStream = new FileOutputStream(path.toFile())) {
1928
this.write(outputStream);
2029
} catch (IOException exception) {

cloudnet-common/src/main/java/de/dytanic/cloudnet/common/document/gson/JsonDocument.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ public class JsonDocument implements IDocument<JsonDocument> {
2929

3030
protected final JsonObject jsonObject;
3131

32+
/**
33+
* @deprecated causes issues because of the relocated Gson, will be made private in a future release
34+
*/
35+
@Deprecated
3236
public JsonDocument(JsonObject jsonObject) {
3337
this.jsonObject = jsonObject;
3438
}
@@ -41,6 +45,10 @@ public JsonDocument(Object toObjectMirror) {
4145
this(GSON.toJsonTree(toObjectMirror));
4246
}
4347

48+
/**
49+
* @deprecated causes issues because of the relocated Gson, will be made private in a future release
50+
*/
51+
@Deprecated
4452
public JsonDocument(JsonElement jsonElement) {
4553
this(jsonElement.isJsonObject() ? jsonElement.getAsJsonObject() : new JsonObject());
4654
}
@@ -90,6 +98,10 @@ public static JsonDocument newDocument() {
9098
return new JsonDocument();
9199
}
92100

101+
/**
102+
* @deprecated causes issues because of the relocated Gson, will be removed in a future release
103+
*/
104+
@Deprecated
93105
public static JsonDocument newDocument(JsonObject jsonObject) {
94106
return new JsonDocument(jsonObject);
95107
}
@@ -257,6 +269,10 @@ public JsonDocument append(JsonDocument document) {
257269
}
258270
}
259271

272+
/**
273+
* @deprecated causes issues because of the relocated Gson, will be made private in a future release
274+
*/
275+
@Deprecated
260276
public JsonDocument append(JsonObject jsonObject) {
261277
if (jsonObject == null) {
262278
return this;
@@ -336,7 +352,7 @@ public JsonDocument getDocument(String key) {
336352
JsonElement jsonElement = this.jsonObject.get(key);
337353

338354
if (jsonElement.isJsonObject()) {
339-
return new JsonDocument(jsonElement.getAsJsonObject());
355+
return new JsonDocument(jsonElement);
340356
} else {
341357
return null;
342358
}
@@ -507,6 +523,10 @@ public BigInteger getBigInteger(String key) {
507523
}
508524
}
509525

526+
/**
527+
* @deprecated causes issues because of the relocated Gson, will be removed in a future release
528+
*/
529+
@Deprecated
510530
public JsonArray getJsonArray(String key) {
511531
if (!contains(key)) {
512532
return null;
@@ -521,6 +541,10 @@ public JsonArray getJsonArray(String key) {
521541
}
522542
}
523543

544+
/**
545+
* @deprecated causes issues because of the relocated Gson, will be removed in a future release
546+
*/
547+
@Deprecated
524548
public JsonObject getJsonObject(String key) {
525549
if (!contains(key)) {
526550
return null;
@@ -546,6 +570,10 @@ public Properties getProperties(String key) {
546570
return properties;
547571
}
548572

573+
/**
574+
* @deprecated causes issues because of the relocated Gson, will be removed in a future release
575+
*/
576+
@Deprecated
549577
public JsonElement get(String key) {
550578
if (!contains(key)) {
551579
return null;
@@ -666,6 +694,10 @@ public JsonDocument getDocument(String key, JsonDocument def) {
666694
return this.getDocument(key);
667695
}
668696

697+
/**
698+
* @deprecated causes issues because of the relocated Gson, will be removed in a future release
699+
*/
700+
@Deprecated
669701
public JsonArray getJsonArray(String key, JsonArray def) {
670702
if (!this.contains(key)) {
671703
this.append(key, def);
@@ -674,6 +706,10 @@ public JsonArray getJsonArray(String key, JsonArray def) {
674706
return this.getJsonArray(key);
675707
}
676708

709+
/**
710+
* @deprecated causes issues because of the relocated Gson, will be removed in a future release
711+
*/
712+
@Deprecated
677713
public JsonObject getJsonObject(String key, JsonObject def) {
678714
if (!this.contains(key)) {
679715
this.append(key, def);
@@ -819,6 +855,10 @@ public JsonDocument getProperties() {
819855
return this;
820856
}
821857

858+
/**
859+
* @deprecated causes issues because of the relocated Gson, will be removed in a future release
860+
*/
861+
@Deprecated
822862
public JsonObject toJsonObject() {
823863
return jsonObject;
824864
}
@@ -840,9 +880,9 @@ public String toString() {
840880
return toJson();
841881
}
842882

843-
844883
@Override
845884
public Iterator<String> iterator() {
846885
return this.jsonObject.keySet().iterator();
847886
}
887+
848888
}

0 commit comments

Comments
 (0)