Don't track blockchanges from Superadmins

This commit is contained in:
JeromSar 2013-08-27 12:09:58 +02:00
parent b28a0778b4
commit f45cc11846
2 changed files with 18 additions and 12 deletions

View File

@ -72,7 +72,7 @@ public class TFM_BlockListener implements Listener
Long lastRan = TFM_Heartbeat.getLastRan(); 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.");
} }
else else
{ {
@ -101,12 +101,6 @@ public class TFM_BlockListener implements Listener
} }
} }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onRollbackBlockBreak(BlockBreakEvent event)
{
TFM_RollbackManager.blockBreak(event);
}
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void onBlockPlace(BlockPlaceEvent event) public void onBlockPlace(BlockPlaceEvent event)
{ {
@ -252,10 +246,22 @@ public class TFM_BlockListener implements Listener
} }
} }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onRollbackBlockBreak(BlockBreakEvent event)
{
if (!TFM_SuperadminList.isUserSuperadmin(event.getPlayer()))
{
TFM_RollbackManager.blockBreak(event);
}
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onRollbackBlockPlace(BlockPlaceEvent event) public void onRollbackBlockPlace(BlockPlaceEvent event)
{ {
TFM_RollbackManager.blockPlace(event); if (!TFM_SuperadminList.isUserSuperadmin(event.getPlayer()))
{
TFM_RollbackManager.blockPlace(event);
}
} }
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)

View File

@ -197,22 +197,22 @@ public class TFM_RollbackManager
{ {
return Material.getMaterial(blockId); return Material.getMaterial(blockId);
} }
public int getX() public int getX()
{ {
return x; return x;
} }
public int getY() public int getY()
{ {
return y; return y;
} }
public int getZ() public int getZ()
{ {
return z; return z;
} }
public byte getData() public byte getData()
{ {
return data; return data;