Fixed Null bug

This commit is contained in:
jklmao committed 2023-01-14 09:00:39 +01:00
1 parent de50de3042
commit 262a553e9e
3 files changed
+25 -11

No files matched your search

@@ -94,6 +94,13 @@ public class CommandTpa implements CommandExecutor {
@Override
public void run() {
if (!p.isOnline()) {
task.cancel();
task = null;
return;
}
if (time == 0) {
task.cancel();
p.sendMessage(colorize(clicktpa.getConfig().getString("Player-teleportation-request-expire")));
@@ -117,12 +124,12 @@ public class CommandTpa implements CommandExecutor {
task = null;
return;
}
}
if (clicktpa.getTpaPlayers().get(p).getMode() == TeleportMode.TELEPORTING) {
task.cancel();
task = null;
return;
if (clicktpa.getTpaPlayers().get(p).getMode() == TeleportMode.TELEPORTING) {
task.cancel();
task = null;
return;
}
}
time = time - 1;
@@ -93,6 +93,13 @@ public class CommandTpaHere implements CommandExecutor {
@Override
public void run() {
System.out.println(clicktpa.getTpaPlayers());
if (!p.isOnline()) {
task.cancel();
task = null;
return;
}
if (time == 0) {
task.cancel();
p.sendMessage(colorize(clicktpa.getConfig().getString("Player-teleportation-request-expire")));
@@ -116,12 +123,12 @@ public class CommandTpaHere implements CommandExecutor {
task = null;
return;
}
}
if (clicktpa.getTpaPlayers().get(p).getMode() == TeleportMode.TELEPORTING) {
task.cancel();
task = null;
return;
if (clicktpa.getTpaPlayers().get(p).getMode() == TeleportMode.TELEPORTING) {
task.cancel();
task = null;
return;
}
}
time = time - 1;
+1 -1
View File
@@ -1,5 +1,5 @@
name: ClickTpa
version: 1.6.4
version: 1.7
main: com.jklmao.plugin.ClickTpa
authors: [ jklmao ]
description: Simple TPA plugin for Spigot/Paper Software