mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-16 12:26:12 +00:00
remove freecam protection whatever
Signed-off-by: Robinson Gallego <robinson.leal7@gmail.com>
This commit is contained in:
parent
5ab0feebfd
commit
ca868a290d
@ -38,37 +38,8 @@ public class AntiNuke extends FreedomService
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
final Location location = event.getBlock().getLocation();
|
|
||||||
final FPlayer fPlayer = plugin.pl.getPlayer(player);
|
final FPlayer fPlayer = plugin.pl.getPlayer(player);
|
||||||
|
|
||||||
final Location playerLocation = player.getLocation();
|
|
||||||
|
|
||||||
final double nukeMonitorRange = ConfigEntry.NUKE_MONITOR_RANGE.getDouble();
|
|
||||||
|
|
||||||
boolean outOfRange = false;
|
|
||||||
if (!playerLocation.getWorld().equals(location.getWorld()))
|
|
||||||
{
|
|
||||||
outOfRange = true;
|
|
||||||
}
|
|
||||||
else if (playerLocation.distanceSquared(location) > (nukeMonitorRange * nukeMonitorRange))
|
|
||||||
{
|
|
||||||
outOfRange = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (outOfRange)
|
|
||||||
{
|
|
||||||
if (fPlayer.incrementAndGetFreecamDestroyCount() > ConfigEntry.FREECAM_TRIGGER_COUNT.getInteger())
|
|
||||||
{
|
|
||||||
FUtil.bcastMsg(player.getName() + " has been flagged for possible freecam nuking.", ChatColor.RED);
|
|
||||||
plugin.ae.autoEject(player, "Freecam (extended range) block breaking is not permitted on this server.");
|
|
||||||
|
|
||||||
fPlayer.resetFreecamDestroyCount();
|
|
||||||
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fPlayer.incrementAndGetBlockDestroyCount() > ConfigEntry.NUKE_MONITOR_COUNT_BREAK.getInteger())
|
if (fPlayer.incrementAndGetBlockDestroyCount() > ConfigEntry.NUKE_MONITOR_COUNT_BREAK.getInteger())
|
||||||
{
|
{
|
||||||
FUtil.bcastMsg(player.getName() + " is breaking blocks too fast!", ChatColor.RED);
|
FUtil.bcastMsg(player.getName() + " is breaking blocks too fast!", ChatColor.RED);
|
||||||
@ -90,37 +61,8 @@ public class AntiNuke extends FreedomService
|
|||||||
}
|
}
|
||||||
|
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Location blockLocation = event.getBlock().getLocation();
|
|
||||||
FPlayer fPlayer = plugin.pl.getPlayer(player);
|
FPlayer fPlayer = plugin.pl.getPlayer(player);
|
||||||
|
|
||||||
Location playerLocation = player.getLocation();
|
|
||||||
|
|
||||||
double nukeMonitorRange = ConfigEntry.NUKE_MONITOR_RANGE.getDouble();
|
|
||||||
|
|
||||||
boolean outOfRange = false;
|
|
||||||
if (!playerLocation.getWorld().equals(blockLocation.getWorld()))
|
|
||||||
{
|
|
||||||
outOfRange = true;
|
|
||||||
}
|
|
||||||
else if (playerLocation.distanceSquared(blockLocation) > (nukeMonitorRange * nukeMonitorRange))
|
|
||||||
{
|
|
||||||
outOfRange = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (outOfRange)
|
|
||||||
{
|
|
||||||
if (fPlayer.incrementAndGetFreecamPlaceCount() > ConfigEntry.FREECAM_TRIGGER_COUNT.getInteger())
|
|
||||||
{
|
|
||||||
FUtil.bcastMsg(player.getName() + " has been flagged for possible freecam building.", ChatColor.RED);
|
|
||||||
plugin.ae.autoEject(player, "Freecam (extended range) block building is not permitted on this server.");
|
|
||||||
|
|
||||||
fPlayer.resetFreecamPlaceCount();
|
|
||||||
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (fPlayer.incrementAndGetBlockPlaceCount() > ConfigEntry.NUKE_MONITOR_COUNT_PLACE.getInteger())
|
if (fPlayer.incrementAndGetBlockPlaceCount() > ConfigEntry.NUKE_MONITOR_COUNT_PLACE.getInteger())
|
||||||
{
|
{
|
||||||
FUtil.bcastMsg(player.getName() + " is placing blocks too fast!", ChatColor.RED);
|
FUtil.bcastMsg(player.getName() + " is placing blocks too fast!", ChatColor.RED);
|
||||||
|
Loading…
Reference in New Issue
Block a user