[ci skip] Add more identifying patch comments, merge related patches

This commit is contained in:
Nassim Jahnke
2024-01-19 12:30:04 +01:00
parent 864f4072c1
commit b5b92e90d8
38 changed files with 181 additions and 229 deletions

View File

@@ -264,7 +264,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
world.getProfiler().pop();
}
+ // Paper start
+ // Paper start - Add mobcaps commands
+ public static int globalLimitForCategory(final ServerLevel level, final MobCategory category, final int spawnableChunkCount) {
+ final int categoryLimit = level.getWorld().getSpawnLimitUnsafe(CraftSpawnCategory.toBukkit(category));
+ if (categoryLimit < 1) {
@@ -272,7 +272,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ return categoryLimit * spawnableChunkCount / NaturalSpawner.MAGIC_NUMBER;
+ }
+ // Paper end
+ // Paper end - Add mobcaps commands
+
public static void spawnCategoryForChunk(MobCategory group, ServerLevel world, LevelChunk chunk, NaturalSpawner.SpawnPredicate checker, NaturalSpawner.AfterSpawnCallback runner) {
// Paper start - add parameters and int ret type
@@ -285,11 +285,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public int getSpawnLimit(SpawnCategory spawnCategory) {
+ // Paper start
+ // Paper start - Add mobcaps commands
+ return this.getSpawnLimitUnsafe(spawnCategory);
+ }
+ public int getSpawnLimitUnsafe(final SpawnCategory spawnCategory) {
+ // Paper end
+ // Paper end - Add mobcaps commands
return this.spawnCategoryLimit.getOrDefault(spawnCategory, -1);
}
@@ -301,7 +301,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
Preconditions.checkArgument(spawnCategory != null, "SpawnCategory cannot be null");
Preconditions.checkArgument(CraftSpawnCategory.isValidForLimits(spawnCategory), "SpawnCategory.%s are not supported", spawnCategory);
+ // Paper start
+ // Paper start - Add mobcaps commands
+ return this.getSpawnLimitUnsafe(spawnCategory);
+ }
+ public final int getSpawnLimitUnsafe(final SpawnCategory spawnCategory) {
@@ -309,7 +309,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (limit < 0) {
- limit = this.server.getSpawnLimit(spawnCategory);
+ limit = this.server.getSpawnLimitUnsafe(spawnCategory);
+ // Paper end
+ // Paper end - Add mobcaps commands
}
return limit;
}