Yatopia/patches/server/0059-Fix-merging-spawning-values.patch
Ivan Pekov e37628ad1e
Some small patches
Fixes an issue with limits being ignored with per player spawning
Fixes an issue where you would be respawned south no matter the rotation of your spawn point.

Additionally, removed Producer#fillList(Producer, List) from the collisions patch and moved it
where it is first used. That's a misc maintainability change, but we have to be consistent!
2020-09-28 16:33:03 +03:00

27 lines
1.6 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mariell Hoversholm <proximyst@proximyst.com>
Date: Mon, 28 Sep 2020 16:25:34 +0300
Subject: [PATCH] Fix merging spawning values
diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
index 62e7282b4baf375d57f881241231ebf2ce1b82ad..7e99aa27fc4cac2e553d0b84dcf85f8f637d5451 100644
--- a/src/main/java/net/minecraft/server/SpawnerCreature.java
+++ b/src/main/java/net/minecraft/server/SpawnerCreature.java
@@ -161,9 +161,12 @@ public final class SpawnerCreature {
spawnercreature_d.a(entityinsentient, ichunkaccess);
},
difference, worldserver.paperConfig.perPlayerMobSpawns ? worldserver.getChunkProvider().playerChunkMap::updatePlayerMobTypeMap : null);
- spawnercreature_d.getEntityCountsByType().mergeInt(enumcreaturetype, spawnCount, (keyInMap, valueInMap) -> {
- return Integer.valueOf(spawnCount + valueInMap.intValue());
- });
+ // Yatopia start - fix this
+ //spawnercreature_d.getEntityCountsByType().mergeInt(enumcreaturetype, spawnCount, (keyInMap, valueInMap) -> {
+ // return Integer.valueOf(spawnCount + valueInMap.intValue());
+ //});
+ spawnercreature_d.getEntityCountsByType().mergeInt(enumcreaturetype, spawnCount, Integer::sum);
+ // Yatopia end
// Paper end - per player mob spawning
}
}