Skip to content

Commit

Permalink
fixed task not finsh
Browse files Browse the repository at this point in the history
  • Loading branch information
CO-UnknowKE committed Sep 14, 2022
1 parent 5487dc3 commit 43b1180
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>net.playl.scccpdebris</groupId>
<artifactId>scccpdebris</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<packaging>jar</packaging>
<url>https://wiki.playl.net</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,12 @@ public void fogWhisper(EnderDragonChangePhaseEvent e) {
Bukkit.getScheduler().runTaskTimer(plugin, (task) -> {
if (!p.isOnline()) {
task.cancel();
return;
}
World w = p.getWorld();
if (w.getEnvironment() != Environment.THE_END) {
task.cancel();
return;
}
if (w.getEnderDragonBattle().getEnderDragon() == null) {
try {
Expand All @@ -197,6 +199,7 @@ public void fogWhisper(EnderDragonChangePhaseEvent e) {
}
p.setSendViewDistance(w.getSendViewDistance());
task.cancel();
return;
}
if (!w.getEnderDragonBattle().getBossBar().getPlayers().contains(p)) {
try {
Expand All @@ -205,6 +208,7 @@ public void fogWhisper(EnderDragonChangePhaseEvent e) {
return;
}
task.cancel();
return;
}
}, 5L, 20L);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public void run() {
if (pf.getDuration() <= 30) {
p.setViewDistance(p.getWorld().getViewDistance());
p.setSimulationDistance(p.getWorld().getSimulationDistance());
cancel();
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: scccpdebris
main: net.playl.scccpdebris.Main
version: "1.0.0"
version: "1.0.1"
author: UnknownKE
api-version: 1.19
description: fix flawed part of the Minecraft multiplayer protocol
Expand Down

0 comments on commit 43b1180

Please sign in to comment.