forked from MagicBane/Server
box check
This commit is contained in:
@@ -4818,7 +4818,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
if(!this.timestamps.containsKey("nextBoxCheck"))
|
||||
this.timestamps.put("nextBoxCheck", System.currentTimeMillis() + 10000);
|
||||
|
||||
if(!this.isBoxed && this.timestamps.get("nextBoxCheck") > System.currentTimeMillis()) {
|
||||
if(!this.isBoxed && this.timestamps.get("nextBoxCheck") < System.currentTimeMillis()) {
|
||||
this.isBoxed = checkIfBoxed(this);
|
||||
this.timestamps.put("nextBoxCheck", System.currentTimeMillis() + 10000);
|
||||
}
|
||||
@@ -4853,6 +4853,7 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
|
||||
}
|
||||
public static boolean checkIfBoxed(PlayerCharacter player){
|
||||
try {
|
||||
String machineID = player.getClientConnection().machineID;
|
||||
ArrayList<PlayerCharacter> sameMachine = new ArrayList<>();
|
||||
for (PlayerCharacter pc : SessionManager.getAllActivePlayerCharacters()) {
|
||||
@@ -4867,6 +4868,9 @@ public class PlayerCharacter extends AbstractCharacter {
|
||||
boxed = true;
|
||||
|
||||
return boxed;
|
||||
}catch(Exception e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void updateFlight() {
|
||||
|
||||
Reference in New Issue
Block a user