mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 22:16:03 +00:00
Fix for issue #6 - projectile launch bug
This commit is contained in:
1 parent
31be5a1b8e
commit
79a88c9de2
4 files changed
+2
-25
No files matched your search
@@ -38,7 +38,7 @@ public class BlockListener extends EventListener
|
|||||||
private final CheckManager checkManager = getCheckManager();
|
private final CheckManager checkManager = getCheckManager();
|
||||||
private final Anticheat plugin = getPlugin();
|
private final Anticheat plugin = getPlugin();
|
||||||
private final Configuration config = Anticheat.getManager().getConfiguration();
|
private final Configuration config = Anticheat.getManager().getConfiguration();
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR)
|
@EventHandler(priority = EventPriority.MONITOR)
|
||||||
public void onBlockDamage(BlockDamageEvent event)
|
public void onBlockDamage(BlockDamageEvent event)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
package net.h31ix.anticheat.event;
|
package net.h31ix.anticheat.event;
|
||||||
|
|
||||||
import net.h31ix.anticheat.manage.CheckType;
|
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|||||||
@@ -69,21 +69,12 @@ public class PlayerListener extends EventListener
|
|||||||
|
|
||||||
if (event.getEntity() instanceof Arrow)
|
if (event.getEntity() instanceof Arrow)
|
||||||
{
|
{
|
||||||
// TF2 Heavy does not approve of this action. He yells "NO!"
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkManager.willCheck(player, CheckType.FAST_PROJECTILE))
|
if (checkManager.willCheck(player, CheckType.FAST_PROJECTILE))
|
||||||
{
|
{
|
||||||
if (backend.justLaunched(player))
|
backend.logProjectile(player, this);
|
||||||
{
|
|
||||||
event.setCancelled(!config.silentMode());
|
|
||||||
log("tried to fire projectiles too fast", player, CheckType.FAST_PROJECTILE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
backend.logProjectile(player, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import net.h31ix.anticheat.Anticheat;
|
|
||||||
import net.h31ix.anticheat.event.EventListener;
|
import net.h31ix.anticheat.event.EventListener;
|
||||||
import net.h31ix.anticheat.util.Distance;
|
import net.h31ix.anticheat.util.Distance;
|
||||||
import net.h31ix.anticheat.util.Utilities;
|
import net.h31ix.anticheat.util.Utilities;
|
||||||
@@ -1023,17 +1021,6 @@ public class Backend
|
|||||||
return animated.containsKey(player.getName());
|
return animated.containsKey(player.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean justLaunched(Player player)
|
|
||||||
{
|
|
||||||
if (projectileHold.contains(player.getName()))
|
|
||||||
{
|
|
||||||
increment(player, projectilesShot, PROJECTILE_MAX);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void logProjectile(final Player player, final EventListener e)
|
public void logProjectile(final Player player, final EventListener e)
|
||||||
{
|
{
|
||||||
if (projectileHold.contains(player.getName()))
|
if (projectileHold.contains(player.getName()))
|
||||||
|
|||||||
Reference in new issue
Block a user