diff --git a/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java index 855ff0559..e56dced09 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/CustomTagFix.java @@ -35,6 +35,7 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerToggleFlightEvent; +import org.bukkit.event.player.PlayerVelocityEvent; import org.bukkit.plugin.java.JavaPlugin; import fr.neatmonster.nocheatplus.NCPAPIProvider; @@ -88,9 +89,37 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler return; } - NCPExemptionManager.exemptPermanently(event.getPlayer()); + try + { + NCPExemptionManager.exemptPermanently(event.getPlayer()); + } + catch (Exception exception) + { + + } + + _exemptTimeMap.put(event.getPlayer().getUniqueId(), System.currentTimeMillis() + 1500); + } + + @EventHandler + public void ncpExemptVelocity(final PlayerVelocityEvent event) + { + if (_exemptTimeMap.containsKey(event.getPlayer().getUniqueId())) + { + _exemptTimeMap.put(event.getPlayer().getUniqueId(), System.currentTimeMillis() + 1500); + return; + } + + try + { + NCPExemptionManager.exemptPermanently(event.getPlayer()); + } + catch (Exception exception) + { + + } + _exemptTimeMap.put(event.getPlayer().getUniqueId(), System.currentTimeMillis() + 1500); - event.getPlayer().sendMessage(event.getPlayer().getName() + " ignored."); } @EventHandler @@ -107,12 +136,14 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler if (System.currentTimeMillis() > entry.getValue()) { iterator.remove(); - NCPExemptionManager.unexempt(entry.getKey()); - Player player = Bukkit.getPlayer(entry.getKey()); - if (player != null) + try { - player.sendMessage(player.getName() + " not ignored."); + NCPExemptionManager.unexempt(entry.getKey()); + } + catch (Exception exception) + { + } } }