Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed obfuscated nms in favor of mojang-mappings jars
- Loading branch information
1 parent
f688eb0
commit 7432606
Showing
105 changed files
with
5,546 additions
and
5,620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
src/main/java/com/bgsoftware/wildchests/utils/ServerVersion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.bgsoftware.wildchests.utils; | ||
|
||
import org.bukkit.Bukkit; | ||
|
||
public enum ServerVersion { | ||
|
||
v1_7(17), | ||
v1_8(18), | ||
v1_9(19), | ||
v1_10(110), | ||
v1_11(111), | ||
v1_12(112), | ||
v1_13(113), | ||
v1_14(114), | ||
v1_15(115), | ||
v1_16(116), | ||
v1_17(117), | ||
v1_18(118), | ||
v1_19(119); | ||
|
||
private static final ServerVersion currentVersion; | ||
private static final String bukkitVersion; | ||
private static final boolean legacy; | ||
|
||
static { | ||
bukkitVersion = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3]; | ||
String[] sections = bukkitVersion.split("_"); | ||
currentVersion = ServerVersion.valueOf(sections[0] + "_" + sections[1]); | ||
legacy = isLessThan(ServerVersion.v1_13); | ||
} | ||
|
||
private final int code; | ||
|
||
ServerVersion(int code) { | ||
this.code = code; | ||
} | ||
|
||
|
||
public static boolean isAtLeast(ServerVersion serverVersion) { | ||
return currentVersion.code >= serverVersion.code; | ||
} | ||
|
||
public static boolean isLessThan(ServerVersion serverVersion) { | ||
return currentVersion.code < serverVersion.code; | ||
} | ||
|
||
public static boolean isEquals(ServerVersion serverVersion) { | ||
return currentVersion.code == serverVersion.code; | ||
} | ||
|
||
public static boolean isLegacy() { | ||
return legacy; | ||
} | ||
|
||
public static String getBukkitVersion() { | ||
return bukkitVersion; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
plugins { | ||
id("io.papermc.paperweight.userdev") version "1.3.8" | ||
} | ||
|
||
java { | ||
toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(17)) | ||
} | ||
} | ||
|
||
dependencies { | ||
paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:1.18.1-R0.1-SNAPSHOT") | ||
compileOnly project(":API") | ||
compileOnly parent | ||
} | ||
|
||
shadowJar { | ||
archiveFileName = "${project.name}-exclude.jar" | ||
} | ||
|
||
assemble { | ||
dependsOn(reobfJar) | ||
} | ||
|
||
tasks { | ||
reobfJar { | ||
File outputFile = new File(parent.projectDir, "archive/reobf/${project.name}.jar") | ||
outputJar.set(layout.buildDirectory.file(outputFile.getPath())) | ||
} | ||
} | ||
|
||
if (project.hasProperty('nms.compile_v1_18') && !Boolean.valueOf(project.findProperty("nms.compile_v1_18").toString())) { | ||
project.tasks.all { task -> task.enabled = false } | ||
} |
Oops, something went wrong.