Lambda replacement
This commit is contained in:
parent
65d9d7f2ce
commit
6cbd400636
1 changed files with 5 additions and 8 deletions
|
@ -160,16 +160,13 @@ public class SpawnRuleBulder<M extends Mob> {
|
|||
final List<SpawnRuleEntry> rulesCopy = Lists.newArrayList(this.rules);
|
||||
Collections.sort(rulesCopy);
|
||||
|
||||
SpawnPredicate<M> predicate = new SpawnPredicate<M>() {
|
||||
@Override
|
||||
public boolean test(EntityType<M> entityType, ServerLevelAccessor serverLevelAccessor, MobSpawnType mobSpawnType, BlockPos blockPos, Random random) {
|
||||
for (SpawnRuleEntry rule: rulesCopy) {
|
||||
if (!rule.canSpawn(entityType, serverLevelAccessor, mobSpawnType, blockPos, random)) {
|
||||
return false;
|
||||
}
|
||||
SpawnPredicate<M> predicate = (entityType, serverLevelAccessor, mobSpawnType, blockPos, random) -> {
|
||||
for (SpawnRuleEntry rule: rulesCopy) {
|
||||
if (!rule.canSpawn(entityType, serverLevelAccessor, mobSpawnType, blockPos, random)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
SpawnRestrictionAccessor.callRegister(entityType, spawnType, heightmapType, predicate);
|
||||
|
|
Loading…
Reference in a new issue