Skip to content

Commit

Permalink
Bump the version to 5.0.1, simplify the Github Action
Browse files Browse the repository at this point in the history
  • Loading branch information
BlaneyXYZ committed Oct 24, 2023
1 parent ac096c2 commit fae4876
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 240 deletions.
67 changes: 2 additions & 65 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,61 +4,16 @@ name: Maven Build
on:
push:
branches:
- main
- master
- five_o_o
- nms-no-more
pull_request:

jobs:
# Build 1.20.2 NMS
nms_version:
runs-on: ubuntu-latest
if: "!contains(github.event.commits[0].message, '[ci-skip]')"
steps:
- name: Set up JDK 17 # 1.20.2 can only be built with Java 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Cache 1.20.2 Maven package
id: cacheWild
uses: actions/cache@v3
with:
path: |
~/.m2/repository/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/
~/.m2/repository/org/spigotmc/spigot-parent/
~/.m2/repository/org/spigotmc/minecraft-server/
key: ${{ runner.os }}-spigot-1.20.2-all
restore-keys: ${{ runner.os }}-spigot-1.20.2-all
- name: Cache Maven packages
id: cacheMain
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2_1.20.2
restore-keys: ${{ runner.os }}-m2_1.20.2

- name: Setup BuildTools
run: mkdir BuildTools && wget -O BuildTools/BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
- name: Check 1.20.2 Spigot
id: wild
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/spigot-1.20.2-R0.1-SNAPSHOT.jar && echo "::set-output name=sucess::true" || echo "::set-output name=sucess::false"
- name: Check 1.20.2 Spigot (Mojang)
id: wildMojang
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/spigot-1.20.2-R0.1-SNAPSHOT-remapped-mojang.jar && echo "::set-output name=sucess::true" || echo "::set-output name=sucess::false"
- name: Check 1.20.2 Spigot (Obf)
id: wildObf
run: test -f ~/.m2/repository/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/spigot-1.20.2-R0.1-SNAPSHOT-remapped-obf.jar && echo "::set-output name=sucess::true" || echo "::set-output name=sucess::false"
- name: Build 1.20.2
if: steps.wild.outputs.sucess != 'true' || steps.wildMojang.outputs.sucess != 'true' || steps.wildObf.outputs.sucess != 'true'
run: cd BuildTools && java -jar BuildTools.jar --rev 1.20.2 --compile craftbukkit --compile-if-changed


# Build RoyalCommands using Maven
build-rcmds:
runs-on: ubuntu-latest
if: "!contains(github.event.commits[0].message, '[ci-skip]')"
needs: nms_version

steps:
- name: Checkout RoyalCommands
Expand All @@ -69,25 +24,7 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'

- name: Cache 1.20.2 Maven package
id: cacheWild
uses: actions/cache@v3
with:
path: |
~/.m2/repository/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/
~/.m2/repository/org/spigotmc/spigot-parent/
~/.m2/repository/org/spigotmc/minecraft-server/
key: ${{ runner.os }}-spigot-1.20.2-all
restore-keys: ${{ runner.os }}-spigot-1.20.2-all

- name: Cache Maven packages
id: cacheMain
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2_1.20.2
restore-keys: ${{ runner.os }}-m2_1.20.2
cache: maven

- name: Build RoyalCommands with Maven
env:
Expand Down
29 changes: 0 additions & 29 deletions modules/NMS1_19_R3/pom.xml

This file was deleted.

This file was deleted.

29 changes: 0 additions & 29 deletions modules/NMS1_20_R2/pom.xml

This file was deleted.

This file was deleted.

29 changes: 1 addition & 28 deletions modules/RoyalCommands/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.royaldev</groupId>
<artifactId>royalcommands</artifactId>
<version>5.0.0</version>
<version>5.0.1-SNAPSHOT</version>
<name>RoyalCommands</name>
<url>https://github.com/RoyalDev/RoyalCommands</url>
<issueManagement>
Expand Down Expand Up @@ -274,33 +274,6 @@
<version>1.1.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.royaldev</groupId>
<artifactId>royalcommands-api</artifactId>
<version>API</version>
<type>jar</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.royaldev</groupId>
<artifactId>royalcommands-NMS1_20_R2</artifactId>
<version>v1_20_R2</version>
<type>jar</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.royaldev</groupId>
<artifactId>royalcommands-NoSupport</artifactId>
<version>NoSupport</version>
<type>jar</type>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.20.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
import org.royaldev.royalcommands.listeners.PlayerListener;
import org.royaldev.royalcommands.listeners.ServerListener;
import org.royaldev.royalcommands.listeners.SignListener;
import org.royaldev.royalcommands.nms.api.NMSFace;
import org.royaldev.royalcommands.protocol.ProtocolListener;
import org.royaldev.royalcommands.rcommands.BaseCommand;
import org.royaldev.royalcommands.rcommands.ReflectCommand;
Expand Down Expand Up @@ -99,7 +98,6 @@ public class RoyalCommands extends JavaPlugin {
public Metrics m = null;
public Config c;
public Help h;
private NMSFace nmsFace;
private CommandMap cm = null;
private YamlConfiguration pluginYml = null;
private RApiMain api;
Expand Down Expand Up @@ -191,29 +189,6 @@ private void initializeMetrics() {
}
}


private void initializeNMS() {
// Get full package string of CraftServer.
// org.bukkit.craftbukkit.versionstring (or for pre-refactor, just org.bukkit.craftbukkit
final String packageName = getServer().getClass().getPackage().getName();
// Get the last element of the package
// If the last element of the package was "craftbukkit" we are now pre-refactor
String versionNMS = packageName.substring(packageName.lastIndexOf('.') + 1);
if ("craftbukkit".equals(versionNMS)) versionNMS = "NoSupport";
try {
// Check if we have a NMSHandler class at that location.
final Class<?> clazz = Class.forName("org.royaldev.royalcommands.nms." + versionNMS + ".NMSHandler");
// Make sure it actually implements NMS and set our handler
if (NMSFace.class.isAssignableFrom(clazz)) this.nmsFace = (NMSFace) clazz.getConstructor().newInstance();
} catch (final Exception e) {
this.getLogger().log(Level.WARNING, "Could not find support for this CraftBukkit version ({0}).", versionNMS);
this.getLogger().info("The GitHub page has links to the newest development builds to fix this.");
this.getLogger().info("For now, NMS/CB internal support will be disabled.");
this.nmsFace = new org.royaldev.royalcommands.nms.NoSupport.NMSHandler();
}
if (this.nmsFace.hasSupport()) getLogger().info("Loaded support for " + this.nmsFace.getVersion() + ".");
}

private void initializeTasks() {
final BukkitScheduler bs = this.getServer().getScheduler();
bs.runTaskTimerAsynchronously(this, new Runnable() {
Expand Down Expand Up @@ -398,10 +373,6 @@ public FancyConfiguration getFancyConfig() {
return fc;
}

public NMSFace getNMSFace() {
return this.nmsFace;
}

public int getNumberVanished() {
int hid = 0;
for (Player p : getServer().getOnlinePlayers()) if (this.isVanished(p)) hid++;
Expand Down Expand Up @@ -495,10 +466,6 @@ public void onEnable() {

this.initializeConfManagers();

//-- Work out NMS magic using mbaxter's glorious methods --//

this.initializeNMS();

//-- Hidendra's Metrics --//

this.initializeMetrics();
Expand Down
2 changes: 1 addition & 1 deletion modules/RoyalCommands/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ api-version: 1.20
website: http://rcmds.wma.im/
description: A general plugin containing all the commands a discerning server admin could want.
authors: [jkcclemens, The Worldwide Minecraft Alliance]
softdepend: [VanishNoPacket, LWC, WorldGuard, Multiverse-Core, Vault, ProtocolLib]
softdepend: [VanishNoPacket, LWC, WorldGuard, Multiverse-Core, Vault, ProtocolLib, RoyalChat]

reflectcommands:
accountstatus:
Expand Down
3 changes: 0 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
</properties>

<modules>
<module>modules/API</module>
<module>modules/NMS1_20_R2</module>
<module>modules/NoSupport</module>
<module>modules/RoyalCommands</module>
</modules>

Expand Down

0 comments on commit fae4876

Please sign in to comment.