diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 70f1c61..ceb7b56 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,9 +4,6 @@ on: push: branches: - '**' - pull_request: - branches: - - '**' jobs: build-and-deploy: @@ -25,6 +22,12 @@ jobs: - name: Build plugin with Maven run: mvn clean package + - name: Upload Corpse plugin JAR + uses: actions/upload-artifact@v4 + with: + name: Corpse-plugin + path: target/Corpse-*.jar + - name: Deploy shaded plugin to VPS run: | # Find the shaded JAR (exclude original-*.jar) diff --git a/pom.xml b/pom.xml index 57ee1b4..a159716 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,6 @@ 8 - @@ -53,8 +52,8 @@ com.github.retrooper packetevents-spigot - 2.10.1 - + 2.11.2 + @@ -69,12 +68,11 @@ - + org.apache.maven.plugins maven-shade-plugin - 3.5.2 - + 3.6.1 package @@ -82,29 +80,31 @@ shade + false - false - - io.github.retrooper.packetevents - com.github.unldenis.corpse.external.packetevents + com.github.retrooper + com.github.unldenis.corpse.libs.packetevents + + + io.github.retrooper + com.github.unldenis.corpse.libs.packetevents + + net.kyori + com.github.unldenis.corpse.libs.kyori + + - - - - com.github.retrooper:packetevents-spigot - - - - - - + diff --git a/src/main/java/com/github/unldenis/corpse/CorpsePlugin.java b/src/main/java/com/github/unldenis/corpse/CorpsePlugin.java index ac70cbc..e155094 100644 --- a/src/main/java/com/github/unldenis/corpse/CorpsePlugin.java +++ b/src/main/java/com/github/unldenis/corpse/CorpsePlugin.java @@ -113,17 +113,19 @@ public void onEnable() { @Override public void onDisable() { - BukkitTask task = pool.getTickTask(); - if (task != null) { - task.cancel(); + if(pool != null) { + BukkitTask task = pool.getTickTask(); + if (task != null) { + task.cancel(); + } + for (Corpse c : pool.getCorpses()) { + c.getSeeingPlayers() + .forEach(c::hide); + } } - for (Corpse c : pool.getCorpses()) { - c.getSeeingPlayers() - .forEach(c::hide); + if(PacketEvents.getAPI() != null) { + PacketEvents.getAPI().terminate(); } - - //Terminate the instance (clean up process) - PacketEvents.getAPI().terminate(); } @NotNull diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 306caf9..6fa1a4c 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -3,6 +3,13 @@ version: ${project.version} api-version: "1.13" author: unldenis main: com.github.unldenis.corpse.CorpsePlugin +softdepend: + - ProtocolLib + - ProtocolSupport + - ViaVersion + - ViaBackwards + - ViaRewind + - Geyser-Spigot commands: spawncorpse: removecorpse: \ No newline at end of file