13
0
geforkt von Mirrors/Paper

fix more compile issues

Dieser Commit ist enthalten in:
Jake Potrebic 2024-12-14 22:43:34 -08:00
Ursprung 172a80cb66
Commit 42cecc53c1
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 27CC63F7CBC866C7

Datei anzeigen

@ -28,7 +28,7 @@
BlockPos blockPos = entity.blockPosition();
chunkGetter.query(ChunkPos.asLong(blockPos), chunk -> {
MobSpawnSettings.MobSpawnCost mobSpawnCost = getRoughBiome(blockPos, chunk).getMobSettings().getMobSpawnCost(entity.getType());
@@ -96,17 +_,36 @@
@@ -96,17 +_,37 @@
return chunk.getNoiseBiome(QuartPos.fromBlock(pos.getX()), QuartPos.fromBlock(pos.getY()), QuartPos.fromBlock(pos.getZ())).value();
}
@ -68,8 +68,9 @@
+ if ((spawnFriendlies || !enumcreaturetype.isFriendly())
+ && (spawnEnemies || enumcreaturetype.isFriendly())
+ && (spawnPassives || !enumcreaturetype.isPersistent())
+ && spawnState.canSpawnForCategoryGlobal(enumcreaturetype)) {
+ && spawnState.canSpawnForCategoryGlobal(enumcreaturetype, limit)) { // Paper - Optional per player mob spawns; remove global check, check later during the local one
+ list.add(enumcreaturetype);
+ // CraftBukkit end
}
}
@ -96,7 +97,7 @@
int y = pos.getY();
- BlockState blockState = chunk.getBlockState(pos);
- if (!blockState.isRedstoneConductor(chunk, pos)) {
+ BlockState blockState = chunk.getBlockStateIfLoadedAndInBounds(pos); // Paper - don't load chunks for mob spawn
+ BlockState blockState = level.getBlockStateIfLoadedAndInBounds(pos); // Paper - don't load chunks for mob spawn
+ if (blockState != null && !blockState.isRedstoneConductor(chunk, pos)) { // Paper - don't load chunks for mob spawn
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos();
int i = 0;