Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
push:
branches:
- '**'
pull_request:
branches:
- '**'

jobs:
build-and-deploy:
Expand All @@ -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)
Expand Down
40 changes: 20 additions & 20 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
<maven.compiler.target>8</maven.compiler.target>
</properties>


<repositories>
<!-- This adds the Spigot Maven repository to the build -->
<repository>
Expand Down Expand Up @@ -53,8 +52,8 @@
<dependency>
<groupId>com.github.retrooper</groupId>
<artifactId>packetevents-spigot</artifactId>
<version>2.10.1</version>
<!-- <scope>provided</scope>-->
<version>2.11.2</version>
<!-- <scope>compile</scope> -->
</dependency>
</dependencies>

Expand All @@ -69,42 +68,43 @@
</resource>
</resources>

<plugins>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.2</version>

<version>3.6.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<!-- <minimizeJar>false</minimizeJar> -->
<createDependencyReducedPom>false</createDependencyReducedPom>
<minimizeJar>false</minimizeJar>

<relocations>
<relocation>
<pattern>io.github.retrooper.packetevents</pattern>
<shadedPattern>com.github.unldenis.corpse.external.packetevents</shadedPattern>
<pattern>com.github.retrooper</pattern>
<shadedPattern>com.github.unldenis.corpse.libs.packetevents</shadedPattern>
</relocation>
<relocation>
<pattern>io.github.retrooper</pattern>
<shadedPattern>com.github.unldenis.corpse.libs.packetevents</shadedPattern>
</relocation>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>com.github.unldenis.corpse.libs.kyori</shadedPattern>
</relocation>
<!-- <relocation>
<pattern>com.google.gson</pattern>
<shadedPattern>com.github.unldenis.corpse.libs.gson</shadedPattern>
</relocation> -->
</relocations>

<artifactSet>
<includes>
<include>com.github.retrooper:packetevents-spigot</include>
<!-- include more dependencies here if needed -->
</includes>
</artifactSet>

</configuration>
</execution>
</executions>
</plugin>

</plugins>
</plugins>

</build>
</project>
20 changes: 11 additions & 9 deletions src/main/java/com/github/unldenis/corpse/CorpsePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: