From ddde487295125156cef45a527b81da2a5a4ea88c Mon Sep 17 00:00:00 2001 From: stijnb1234 Date: Sat, 18 Apr 2020 10:19:24 +0200 Subject: [PATCH] Fixed message issue --- .../java/nl/sbdeveloper/themeparkplus/commands/TPPCMD.java | 2 +- .../themeparkplus/listeners/AntiFreerunListener.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/nl/sbdeveloper/themeparkplus/commands/TPPCMD.java b/src/main/java/nl/sbdeveloper/themeparkplus/commands/TPPCMD.java index 83af0e4..8a2162a 100644 --- a/src/main/java/nl/sbdeveloper/themeparkplus/commands/TPPCMD.java +++ b/src/main/java/nl/sbdeveloper/themeparkplus/commands/TPPCMD.java @@ -203,7 +203,7 @@ public class TPPCMD implements CommandExecutor { return true; } - if (amount != 0) { + if (amount == 0) { if (ConfigUtil.sendConsole(sender)) sender.sendMessage(ConfigUtil.getMessage("Gates.Opened")); } else { if (ConfigUtil.sendConsole(sender)) sender.sendMessage(ConfigUtil.getMessage("Gates.OpenedAmount", Collections.singletonMap("%amount%", String.valueOf(amount)))); diff --git a/src/main/java/nl/sbdeveloper/themeparkplus/listeners/AntiFreerunListener.java b/src/main/java/nl/sbdeveloper/themeparkplus/listeners/AntiFreerunListener.java index 2dbf181..0c55dff 100644 --- a/src/main/java/nl/sbdeveloper/themeparkplus/listeners/AntiFreerunListener.java +++ b/src/main/java/nl/sbdeveloper/themeparkplus/listeners/AntiFreerunListener.java @@ -6,10 +6,11 @@ import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import org.jetbrains.annotations.NotNull; public class AntiFreerunListener implements Listener { @EventHandler - public void onJoin(PlayerJoinEvent e) { + public void onJoin(@NotNull PlayerJoinEvent e) { Player p = e.getPlayer(); if (!p.hasPermission("tpp.bypassantifreerun")) { p.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 1000000, -2, false, false));