Spawn Cake islands based off the mid capture point
This commit is contained in:
parent
f572007dad
commit
3aee4dc1f7
@ -51,6 +51,7 @@ public class CakeIslandModule extends CakeModule
|
||||
private final Map<Location, CakeIsland> _islands;
|
||||
private final Set<Pair<Location, Pair<Material, Byte>>> _schematic;
|
||||
|
||||
private Location _center;
|
||||
private long _lastIsland;
|
||||
|
||||
public CakeIslandModule(CakeWars game)
|
||||
@ -61,6 +62,12 @@ public class CakeIslandModule extends CakeModule
|
||||
_schematic = new HashSet<>(200);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setup()
|
||||
{
|
||||
_center = _game.WorldData.GetDataLocs("WHITE").get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cleanup()
|
||||
{
|
||||
@ -244,7 +251,7 @@ public class CakeIslandModule extends CakeModule
|
||||
attemptsLoop:
|
||||
while (location == null || attempts++ < MAX_ATTEMPTS)
|
||||
{
|
||||
location = UtilAlg.getRandomLocation(_game.GetSpectatorLocation().clone().subtract(0, 18, 0), MAX_XZ, 0, MAX_XZ);
|
||||
location = UtilAlg.getRandomLocation(_center, MAX_XZ, 0, MAX_XZ);
|
||||
Chunk chunk = location.getChunk();
|
||||
|
||||
// Prevent islands spawning inside other blocks
|
||||
|
Loading…
Reference in New Issue
Block a user