Attempt to somewhat fix the lag whenever the game starts

This commit is contained in:
Sam 2017-06-30 13:56:20 +01:00
parent 67d792e9d7
commit 811463e586
4 changed files with 7 additions and 8 deletions

View File

@ -119,10 +119,10 @@ public abstract class BattleRoyale extends Game
// TODO REMOVE THIS // TODO REMOVE THIS
TeleportsDisqualify = false; TeleportsDisqualify = false;
TickPerTeleport = 20;
PrepareTime = PREPARE_TIME; PrepareTime = PREPARE_TIME;
PrepareFreeze = false; PrepareFreeze = false;
SpawnTeleport = false;
Damage = false; Damage = false;
DamageTeamSelf = true; DamageTeamSelf = true;
DeathDropItems = true; DeathDropItems = true;
@ -172,7 +172,7 @@ public abstract class BattleRoyale extends Game
chestSpawns.addAll(WorldData.GetDataLocs("BLUE")); chestSpawns.addAll(WorldData.GetDataLocs("BLUE"));
new ChestLootModule() new ChestLootModule()
.destoryAfterOpened(20) .destroyAfterOpened(20)
.spawnNearbyDataPoints() .spawnNearbyDataPoints()
.registerChestType("Standard", chestSpawns, .registerChestType("Standard", chestSpawns,
@ -422,7 +422,7 @@ public abstract class BattleRoyale extends Game
index.getAndIncrement(); index.getAndIncrement();
} }
}, 200, 2); }, 40, 2);
} }
private Location getPlayerSpawn(int initialXZ) private Location getPlayerSpawn(int initialXZ)

View File

@ -103,7 +103,8 @@ public class BattleRoyaleSolo extends BattleRoyale
if (_supplyDrop != null) if (_supplyDrop != null)
{ {
_supplyDropLocation = UtilWorld.locToStrClean(_supplyDrop.getDropLocation()); Location location = _supplyDrop.getDropLocation();
_supplyDropLocation = "(" + location.getBlockX() + ", " + location.getBlockZ() + ")";
_supplyDropState = _supplyDrop.getScoreboardString(); _supplyDropState = _supplyDrop.getScoreboardString();
} }
else else

View File

@ -59,12 +59,11 @@ class BattleRoyaleSupplyDrop implements Listener
private boolean _dropped; private boolean _dropped;
private boolean _opened; private boolean _opened;
private boolean _landed; private boolean _landed;
private long _openedAt;
BattleRoyaleSupplyDrop(BattleRoyale host, Location dropLocation) BattleRoyaleSupplyDrop(BattleRoyale host, Location dropLocation)
{ {
_host = host; _host = host;
_dropLocation = dropLocation; _dropLocation = dropLocation.clone();
_start = System.currentTimeMillis(); _start = System.currentTimeMillis();
_beaconBlocks = new HashSet<>(); _beaconBlocks = new HashSet<>();
_chute = new ArrayList<>(); _chute = new ArrayList<>();
@ -157,7 +156,6 @@ class BattleRoyaleSupplyDrop implements Listener
if (UtilMath.offsetSquared(block.getLocation(), _dropLocation) < 4) if (UtilMath.offsetSquared(block.getLocation(), _dropLocation) < 4)
{ {
_opened = true; _opened = true;
_openedAt = System.currentTimeMillis();
cleanup(); cleanup();
} }
} }

View File

@ -64,7 +64,7 @@ public class ChestLootModule extends Module
return this; return this;
} }
public ChestLootModule destoryAfterOpened(int seconds) public ChestLootModule destroyAfterOpened(int seconds)
{ {
_destroyAfterOpened = TimeUnit.SECONDS.toMillis(seconds); _destroyAfterOpened = TimeUnit.SECONDS.toMillis(seconds);
return this; return this;