Skip to content

Commit 2c4022a

Browse files
committed
add support 1.21.11
1 parent 4953ef9 commit 2c4022a

4 files changed

Lines changed: 38 additions & 32 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
push:
55
branches:
66
- '**'
7-
pull_request:
8-
branches:
9-
- '**'
107

118
jobs:
129
build-and-deploy:

pom.xml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<maven.compiler.target>8</maven.compiler.target>
1414
</properties>
1515

16-
1716
<repositories>
1817
<!-- This adds the Spigot Maven repository to the build -->
1918
<repository>
@@ -53,8 +52,8 @@
5352
<dependency>
5453
<groupId>com.github.retrooper</groupId>
5554
<artifactId>packetevents-spigot</artifactId>
56-
<version>2.10.1</version>
57-
<!-- <scope>provided</scope>-->
55+
<version>2.11.2</version>
56+
<scope>compile</scope>
5857
</dependency>
5958
</dependencies>
6059

@@ -69,42 +68,43 @@
6968
</resource>
7069
</resources>
7170

72-
<plugins>
71+
<plugins>
7372
<plugin>
7473
<groupId>org.apache.maven.plugins</groupId>
7574
<artifactId>maven-shade-plugin</artifactId>
76-
<version>3.5.2</version>
77-
75+
<version>3.6.1</version>
7876
<executions>
7977
<execution>
8078
<phase>package</phase>
8179
<goals>
8280
<goal>shade</goal>
8381
</goals>
8482
<configuration>
83+
<!-- <minimizeJar>false</minimizeJar> -->
8584
<createDependencyReducedPom>false</createDependencyReducedPom>
86-
<minimizeJar>false</minimizeJar>
87-
8885
<relocations>
8986
<relocation>
90-
<pattern>io.github.retrooper.packetevents</pattern>
91-
<shadedPattern>com.github.unldenis.corpse.external.packetevents</shadedPattern>
87+
<pattern>com.github.retrooper</pattern>
88+
<shadedPattern>com.github.unldenis.corpse.libs.packetevents</shadedPattern>
89+
</relocation>
90+
<relocation>
91+
<pattern>io.github.retrooper</pattern>
92+
<shadedPattern>com.github.unldenis.corpse.libs.packetevents</shadedPattern>
93+
</relocation>
94+
<relocation>
95+
<pattern>net.kyori</pattern>
96+
<shadedPattern>com.github.unldenis.corpse.libs.kyori</shadedPattern>
97+
</relocation>
98+
<relocation>
99+
<pattern>com.google.gson</pattern>
100+
<shadedPattern>com.github.unldenis.corpse.libs.gson</shadedPattern>
92101
</relocation>
93102
</relocations>
94-
95-
<artifactSet>
96-
<includes>
97-
<include>com.github.retrooper:packetevents-spigot</include>
98-
<!-- include more dependencies here if needed -->
99-
</includes>
100-
</artifactSet>
101-
102103
</configuration>
103104
</execution>
104105
</executions>
105106
</plugin>
106-
107-
</plugins>
107+
</plugins>
108108

109109
</build>
110110
</project>

src/main/java/com/github/unldenis/corpse/CorpsePlugin.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,19 @@ public void onEnable() {
113113

114114
@Override
115115
public void onDisable() {
116-
BukkitTask task = pool.getTickTask();
117-
if (task != null) {
118-
task.cancel();
116+
if(pool != null) {
117+
BukkitTask task = pool.getTickTask();
118+
if (task != null) {
119+
task.cancel();
120+
}
121+
for (Corpse c : pool.getCorpses()) {
122+
c.getSeeingPlayers()
123+
.forEach(c::hide);
124+
}
119125
}
120-
for (Corpse c : pool.getCorpses()) {
121-
c.getSeeingPlayers()
122-
.forEach(c::hide);
126+
if(PacketEvents.getAPI() != null) {
127+
PacketEvents.getAPI().terminate();
123128
}
124-
125-
//Terminate the instance (clean up process)
126-
PacketEvents.getAPI().terminate();
127129
}
128130

129131
@NotNull

src/main/resources/plugin.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ version: ${project.version}
33
api-version: "1.13"
44
author: unldenis
55
main: com.github.unldenis.corpse.CorpsePlugin
6+
softdepend:
7+
- ProtocolLib
8+
- ProtocolSupport
9+
- ViaVersion
10+
- ViaBackwards
11+
- ViaRewind
12+
- Geyser-Spigot
613
commands:
714
spawncorpse:
815
removecorpse:

0 commit comments

Comments
 (0)