mirror of
https://github.com/array-in-a-matrix/brainwine.git
synced 2025-04-02 11:11:58 -04:00
Spawn obelisks now count as spawn blocks
This commit is contained in:
parent
52b003d7fb
commit
e0d2e5c4b2
2 changed files with 4 additions and 4 deletions
|
@ -193,7 +193,7 @@ public class Player extends Entity implements CommandExecutor {
|
|||
*/
|
||||
public void onZoneChanged() {
|
||||
// TODO handle spawns better
|
||||
MetaBlock spawn = zone.getRandomZoneTeleporter();
|
||||
MetaBlock spawn = zone.getRandomSpawnBlock();
|
||||
|
||||
if(spawn == null) {
|
||||
x = zone.getWidth() / 2;
|
||||
|
|
|
@ -614,9 +614,9 @@ public class Zone {
|
|||
return metaBlocks;
|
||||
}
|
||||
|
||||
public MetaBlock getRandomZoneTeleporter() {
|
||||
List<MetaBlock> zoneTeleporters = getMetaBlocksWithUse(ItemUseType.ZONE_TELEPORT);
|
||||
return zoneTeleporters.isEmpty() ? null : zoneTeleporters.get((int)(Math.random() * zoneTeleporters.size()));
|
||||
public MetaBlock getRandomSpawnBlock() {
|
||||
List<MetaBlock> spawnBlocks = getMetaBlocksWhere(block -> block.getItem().getId() == 891 || block.getItem().getId() == 934);
|
||||
return spawnBlocks.isEmpty() ? null : spawnBlocks.get((int)(Math.random() * spawnBlocks.size()));
|
||||
}
|
||||
|
||||
public Collection<MetaBlock> getMetaBlocks() {
|
||||
|
|
Loading…
Add table
Reference in a new issue