-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Modularize Codex for easier updates * Reorganize some other stuff * Get javadocs aggregating properly * Add Nexo support in new code * Code cleanup * Add setKiller to NMSProvider for Fabled * Add 1.21.4 * Remove VersionManager in favor of everything located in NMSProvider Add some other NMS methods to get Divinity and Fabled building * Slight organization tweaks * Split bungee into separate module * Oops * Ignore build directories * Fix some NMS-related issues * Move armor trims to version specific classes * Move other methods to NMS * Create EntityDamageByEntity via version-specific invocations * For testing, we can't actually compile against 1.16... This will be fun * More cleanup * Add some Attribute stuff to compatibility layers * De-Reflection InventoryUtil * Move event interfaces and event definitions to -api * Move other enums/interfaces to -api * Centralize fix/remove colors * Clean up * Fix testing issues * Work out a couple of kinks * Update nexo * Update nexo * Update version updating script * Update workflows * Can I use sdkman to run build tools? * Maybe this will work * More info * More info * Rearrange * Let's build spigot for release builds only * Don't update the nms version automatically
- Loading branch information
Showing
431 changed files
with
5,854 additions
and
3,345 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,40 +1,56 @@ | ||
import os | ||
import re | ||
import sys | ||
|
||
is_dev = len(sys.argv) >= 2 and eval(sys.argv[1].lower().capitalize()) | ||
prep = not is_dev and len(sys.argv) >= 3 and bool(sys.argv[2]) | ||
|
||
|
||
def replace_version(): | ||
regex = r'^[ ]{4}<version>((((\d+\.?)+)((-R(\d+)\.?)(\d+)?)?)(-SNAPSHOT)?)<\/version>$' | ||
with open('pom.xml', 'r') as pom: | ||
def replace_version(pom_path): | ||
regex = r'(<artifactId>.*codex.*<\/artifactId>\s*)<version>((((\d+\.?)+)((-R(\d+)\.?)(\d+)?)?)(-SNAPSHOT)?)<\/version>$' | ||
with open(pom_path, 'r') as pom: | ||
contents = pom.read() | ||
ver = re.findall(regex, contents, re.MULTILINE) | ||
version = ver[0][0] | ||
bare_version = ver[0][2] | ||
version = ver[0][1] | ||
bare_version = ver[0][3] | ||
if is_dev: | ||
if not '-R' in version: | ||
new_version = version + '-R0.1-SNAPSHOT' | ||
elif not '-SNAPSHOT' in version: | ||
new_version = version + '.1-SNAPSHOT' | ||
else: | ||
r_version = ver[0][5] | ||
patch = int(ver[0][7]) + 1 | ||
r_version = ver[0][6] | ||
patch = int(ver[0][8]) + 1 | ||
new_version = bare_version + r_version + str(patch) + '-SNAPSHOT' | ||
elif prep: | ||
r_version = int(ver[0][6]) + 1 | ||
r_version = int(ver[0][7]) + 1 | ||
new_version = bare_version + '-R' + str(r_version) | ||
else: | ||
version = ver[0][2] | ||
minor = int(ver[0][3]) | ||
version = ver[0][3] | ||
minor = int(ver[0][4]) | ||
new_version = version[:-(len(str(minor)))] + str(minor + 1) | ||
contents = re.sub(regex, | ||
' <version>' + new_version + '</version>', | ||
ver[0][0] + '<version>' + new_version + '</version>', | ||
contents, | ||
1, | ||
re.MULTILINE) | ||
with open('pom.xml', 'w') as pom: | ||
with open(pom_path, 'w') as pom: | ||
pom.write(contents) | ||
|
||
|
||
replace_version() | ||
def find_pom_files(directory): | ||
pom_files = [] | ||
for root, dirs, files in os.walk(directory): | ||
for file in files: | ||
if file == 'pom.xml': | ||
pom_files.append(os.path.join(root, file)) | ||
return pom_files | ||
|
||
if __name__ == "__main__": | ||
directory = os.getcwd() | ||
pom_files = find_pom_files(directory) | ||
for pom_file in pom_files: | ||
# NMS versions should be updated manually when NMS is actually changed | ||
if '-nms' in pom_file: continue | ||
print(f'Updating version in {pom_file}') | ||
replace_version(pom_file) |
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 |
---|---|---|
|
@@ -10,19 +10,25 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 21 | ||
java-version: | | ||
11 | ||
17 | ||
21 | ||
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | ||
settings-path: ${{ github.workspace }} # location for the settings.xml file | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
- uses: actions/checkout@v4 | ||
- name: 'Create settings.xml' | ||
uses: s4u/[email protected] | ||
with: | ||
githubServer: false | ||
- name: Build with Maven | ||
run: mvn clean package -e | ||
run: mvn clean package -e -pl \!codex-nms,\!codex-nms/codex-nms-v1_16_5,\!codex-nms/codex-nms-v1_17_1,\ | ||
\!codex-nms/codex-nms-v1_18_2,\!codex-nms/codex-nms-v1_19_4,\!codex-nms/codex-nms-v1_20_2,\ | ||
\!codex-nms/codex-nms-v1_20_4,\!codex-nms/codex-nms-v1_20_6,\!codex-nms/codex-nms-v1_21_1,\ | ||
\!codex-nms/codex-nms-v1_21_2,\!codex-nms/codex-nms-v1_21_4 |
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 |
---|---|---|
|
@@ -10,22 +10,47 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.ACTIONS_PAT }} | ||
- name: Configure git | ||
run: | | ||
git config user.name "Build Monkey" | ||
git config user.email "<>" | ||
- name: Set up JDK 17 | ||
- name: Set up JDK | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: 21 | ||
java-version: | | ||
11 | ||
17 | ||
21 | ||
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | ||
settings-path: ${{ github.workspace }} # location for the settings.xml file | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
- name: Download BuildTools | ||
run: wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar | ||
- name: Build Spigot 1.16.5 | ||
run: $JAVA_HOME_11_X64/bin/java -jar BuildTools.jar --rev 1.16.5 | ||
- name: Build Spigot 1.17.1 | ||
run: $JAVA_HOME_17_X64/bin/java -jar BuildTools.jar --rev 1.17.1 | ||
- name: Build Spigot 1.18.2 | ||
run: $JAVA_HOME_17_X64/bin/java -jar BuildTools.jar --rev 1.18.2 | ||
- name: Build Spigot 1.19.4 | ||
run: $JAVA_HOME_17_X64/bin/java -jar BuildTools.jar --rev 1.19.4 | ||
- name: Build Spigot 1.20.2 | ||
run: java -jar BuildTools.jar --rev 1.20.2 | ||
- name: Build Spigot 1.20.4 | ||
run: java -jar BuildTools.jar --rev 1.20.4 | ||
- name: Build Spigot 1.20.6 | ||
run: java -jar BuildTools.jar --rev 1.20.6 | ||
- name: Build Spigot 1.21.1 | ||
run: java -jar BuildTools.jar --rev 1.21.1 | ||
- name: Build Spigot 1.21.2 | ||
run: java -jar BuildTools.jar --rev 1.21.2 | ||
- name: Build Spigot 1.21.4 | ||
run: java -jar BuildTools.jar --rev 1.21.4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.ACTIONS_PAT }} | ||
- name: 'Create settings.xml' | ||
uses: s4u/[email protected] | ||
with: | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,9 @@ target/ | |
*.iml | ||
/.idea/ | ||
gh-pages/ | ||
apidocs/ | ||
settings.xml | ||
toolchains.xml | ||
log.txt | ||
logs/ | ||
logs/ | ||
**/build/*.jar |
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
File renamed without changes.
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,108 @@ | ||
<?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"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>studio.magemonkey</groupId> | ||
<artifactId>codex-parent</artifactId> | ||
<version>1.1.0-R0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>codex-api</artifactId> | ||
|
||
<repositories> | ||
<repository> | ||
<id>nexo</id> | ||
<name>Nexo Repository</name> | ||
<url>https://repo.nexomc.com/snapshots/</url> | ||
</repository> | ||
<repository> | ||
<id>oraxen</id> | ||
<name>Oraxen Repository</name> | ||
<url>https://repo.oraxen.com/releases</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot-api</artifactId> | ||
<version>1.16.5-R0.1-SNAPSHOT</version> | ||
</dependency> | ||
|
||
|
||
<dependency> | ||
<groupId>studio.magemonkey</groupId> | ||
<artifactId>codex-bungee</artifactId> | ||
<version>1.1.0-R0.1-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.nexomc</groupId> | ||
<artifactId>nexo</artifactId> | ||
<version>0.5.0-dev.14</version> | ||
<classifier>dev</classifier> | ||
<scope>provided</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>*</groupId> | ||
<artifactId>*</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.th0rgal</groupId> | ||
<artifactId>oraxen</artifactId> | ||
<version>1.173.0</version> | ||
<classifier>dev</classifier> | ||
<scope>provided</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>me.gabytm.util</groupId> | ||
<artifactId>actions-spigot</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.jetbrains</groupId> | ||
<artifactId>annotations</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.ticxo</groupId> | ||
<artifactId>PlayerAnimator</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.github.stefvanschie.inventoryframework</groupId> | ||
<artifactId>IF</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>io.th0rgal</groupId> | ||
<artifactId>protectionlib</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>dev.triumphteam</groupId> | ||
<artifactId>triumph-gui</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>org.bstats</groupId> | ||
<artifactId>bstats-bukkit</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.jeff-media</groupId> | ||
<artifactId>custom-block-data</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.jeff-media</groupId> | ||
<artifactId>persistent-data-serializer</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>com.jeff_media</groupId> | ||
<artifactId>MorePersistentDataTypes</artifactId> | ||
</exclusion> | ||
<exclusion> | ||
<groupId>gs.mclo</groupId> | ||
<artifactId>java</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
</dependencies> | ||
</project> |
33 changes: 33 additions & 0 deletions
33
codex-api/src/main/java/studio/magemonkey/codex/Codex.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,33 @@ | ||
package studio.magemonkey.codex; | ||
|
||
import lombok.Setter; | ||
import org.bukkit.plugin.java.JavaPlugin; | ||
|
||
public class Codex { | ||
@Setter | ||
public static JavaPlugin plugin; | ||
|
||
public static JavaPlugin getPlugin() { | ||
if (plugin == null) { | ||
throw new IllegalStateException("Codex has not been initialized"); | ||
} | ||
|
||
return plugin; | ||
} | ||
|
||
public static void info(String message) { | ||
getPlugin().getLogger().info(message); | ||
} | ||
|
||
public static void warn(String message) { | ||
getPlugin().getLogger().warning(message); | ||
} | ||
|
||
public static void error(String message) { | ||
getPlugin().getLogger().severe(message); | ||
} | ||
|
||
public static void trace(String message) { | ||
getPlugin().getLogger().fine(message); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.