mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Increase default nuking block place threshold. Resolves #169
This commit is contained in:
parent
5c99aa9a44
commit
a3f3903760
@ -1,3 +1,3 @@
|
|||||||
#Build Number for ANT. Do not edit!
|
#Build Number for ANT. Do not edit!
|
||||||
#Mon May 05 16:09:04 CEST 2014
|
#Sun May 11 18:05:04 CEST 2014
|
||||||
build.number=824
|
build.number=826
|
||||||
|
@ -95,7 +95,7 @@ auto_wipe: true
|
|||||||
nukemonitor:
|
nukemonitor:
|
||||||
enabled: true
|
enabled: true
|
||||||
count_break: 100
|
count_break: 100
|
||||||
count_place: 25
|
count_place: 40
|
||||||
range: 10.0
|
range: 10.0
|
||||||
|
|
||||||
freecam_trigger_count: 10
|
freecam_trigger_count: 10
|
||||||
|
@ -35,23 +35,23 @@ public class TFM_BlockListener implements Listener
|
|||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void onBlockBreak(BlockBreakEvent event)
|
public void onBlockBreak(BlockBreakEvent event)
|
||||||
{
|
{
|
||||||
Player player = event.getPlayer();
|
final Player player = event.getPlayer();
|
||||||
Location blockLocation = event.getBlock().getLocation();
|
final Location location = event.getBlock().getLocation();
|
||||||
|
|
||||||
if (TFM_ConfigEntry.NUKE_MONITOR_ENABLED.getBoolean())
|
if (TFM_ConfigEntry.NUKE_MONITOR_ENABLED.getBoolean())
|
||||||
{
|
{
|
||||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||||
|
|
||||||
Location playerLocation = player.getLocation();
|
final Location playerLocation = player.getLocation();
|
||||||
|
|
||||||
final double nukeMonitorRange = TFM_ConfigEntry.NUKE_MONITOR_RANGE.getDouble().doubleValue();
|
final double nukeMonitorRange = TFM_ConfigEntry.NUKE_MONITOR_RANGE.getDouble().doubleValue();
|
||||||
|
|
||||||
boolean outOfRange = false;
|
boolean outOfRange = false;
|
||||||
if (!playerLocation.getWorld().equals(blockLocation.getWorld()))
|
if (!playerLocation.getWorld().equals(location.getWorld()))
|
||||||
{
|
{
|
||||||
outOfRange = true;
|
outOfRange = true;
|
||||||
}
|
}
|
||||||
else if (playerLocation.distanceSquared(blockLocation) > (nukeMonitorRange * nukeMonitorRange))
|
else if (playerLocation.distanceSquared(location) > (nukeMonitorRange * nukeMonitorRange))
|
||||||
{
|
{
|
||||||
outOfRange = true;
|
outOfRange = true;
|
||||||
}
|
}
|
||||||
@ -70,7 +70,7 @@ public class TFM_BlockListener implements Listener
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Long lastRan = TFM_Heartbeat.getLastRan();
|
final Long lastRan = TFM_Heartbeat.getLastRan();
|
||||||
if (lastRan == null || lastRan + TotalFreedomMod.HEARTBEAT_RATE * 1000L < System.currentTimeMillis())
|
if (lastRan == null || lastRan + TotalFreedomMod.HEARTBEAT_RATE * 1000L < System.currentTimeMillis())
|
||||||
{
|
{
|
||||||
// TFM_Log.warning("Heartbeat service timeout - can't check block place/break rates.");
|
// TFM_Log.warning("Heartbeat service timeout - can't check block place/break rates.");
|
||||||
@ -94,7 +94,7 @@ public class TFM_BlockListener implements Listener
|
|||||||
{
|
{
|
||||||
if (!TFM_AdminList.isSuperAdmin(player))
|
if (!TFM_AdminList.isSuperAdmin(player))
|
||||||
{
|
{
|
||||||
if (TFM_ProtectedArea.isInProtectedArea(blockLocation))
|
if (TFM_ProtectedArea.isInProtectedArea(location))
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user