mirror of
https://github.com/array-in-a-matrix/brainwine.git
synced 2025-04-02 11:11:58 -04:00
Entities can now spawn from unobstructed orifices in protected areas
This commit is contained in:
parent
6076d7f9b2
commit
ed02336f55
1 changed files with 1 additions and 5 deletions
|
@ -140,16 +140,12 @@ public class EntityManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean tryBustOrifice(int x, int y, Layer layer) {
|
private boolean tryBustOrifice(int x, int y, Layer layer) {
|
||||||
if(zone.isBlockProtected(x, y, null)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Block block = zone.getBlock(x, y);
|
Block block = zone.getBlock(x, y);
|
||||||
Item item = block.getItem(layer);
|
Item item = block.getItem(layer);
|
||||||
int mod = block.getMod(layer);
|
int mod = block.getMod(layer);
|
||||||
|
|
||||||
if(!item.isAir()) {
|
if(!item.isAir()) {
|
||||||
if(random.nextBoolean()) {
|
if(!zone.isBlockProtected(x, y, null) && random.nextBoolean()) {
|
||||||
item = item.getMod() == ModType.DECAY && mod < 5 ? item : Item.AIR;
|
item = item.getMod() == ModType.DECAY && mod < 5 ? item : Item.AIR;
|
||||||
mod = item.isAir() ? 0 : Math.min(5, mod + random.nextInt(1, 3));
|
mod = item.isAir() ? 0 : Math.min(5, mod + random.nextInt(1, 3));
|
||||||
zone.updateBlock(x, y, layer, item, mod);
|
zone.updateBlock(x, y, layer, item, mod);
|
||||||
|
|
Loading…
Add table
Reference in a new issue