box check only every 5 seconds
This commit is contained in:
@@ -179,6 +179,8 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
public int mineAppliedID = 0;
|
||||
|
||||
public long lastAction = 0;
|
||||
|
||||
public long lastBoxCheck = System.currentTimeMillis();
|
||||
/**
|
||||
* No Id Constructor
|
||||
*/
|
||||
@@ -4893,6 +4895,10 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
}
|
||||
|
||||
public static boolean checkIfBoxed(PlayerCharacter player){
|
||||
if(System.currentTimeMillis() < player.lastBoxCheck + 5000)
|
||||
return false;
|
||||
|
||||
player.lastBoxCheck = System.currentTimeMillis();
|
||||
try {
|
||||
for (PlayerCharacter pc : SessionManager.getAllActivePlayers()) {
|
||||
if(pc.getClientConnection().machineID.equals(player.getClientConnection().machineID) == false)
|
||||
|
||||
Reference in New Issue
Block a user