Remove grass only from used spawns
This commit is contained in:
parent
20fdb1f21c
commit
17c51f03ad
@ -389,7 +389,6 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
_deathEffect.removeSpawnedEntities();
|
||||
|
||||
setupChallengeSpawnLocations();
|
||||
System.out.println("Spawns: " + _challenge.getData().getDefinedSpawns().size());
|
||||
_challenge.createMap();
|
||||
|
||||
if (_settings.canMarkSpawnLocations())
|
||||
@ -549,6 +548,20 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
for (Player player : GetPlayers(true))
|
||||
{
|
||||
_playersTeam.SpawnTeleport(player);
|
||||
removeSolidBlock(player.getLocation());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void removeSolidBlock(Location location)
|
||||
{
|
||||
Block block = location.getBlock();
|
||||
|
||||
if (!block.isEmpty() && _challenge.getData().isModifiedBlock(block))
|
||||
{
|
||||
block.setType(Material.AIR);
|
||||
block.setData((byte) 0);
|
||||
_challenge.getData().removeModifiedBlock(block);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ public abstract class Challenge implements Listener
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Block generateGrass(Block block)
|
||||
{
|
||||
if (!Data.isSpawnLocation(block.getLocation()) && UtilMath.r(4) == 0)
|
||||
if (UtilMath.r(4) == 0)
|
||||
{
|
||||
if (UtilMath.r(8) == 0)
|
||||
{
|
||||
|
@ -120,6 +120,11 @@ public class ChallengeData
|
||||
{
|
||||
_modifiedBlocks.add(block);
|
||||
}
|
||||
|
||||
public boolean isModifiedBlock(Block block)
|
||||
{
|
||||
return _modifiedBlocks.contains(block);
|
||||
}
|
||||
|
||||
public void removeModifiedBlock(Block block)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user