diff --git a/PATCHES.md b/PATCHES.md index ac019ae1..2578364d 100644 --- a/PATCHES.md +++ b/PATCHES.md @@ -56,6 +56,7 @@ # Patches | server | Fix LightEngineThreaded memory leak | Ivan Pekov | | | server | Fix exp drop of zombie pigmen (MC-56653) | Phoenix616 | | | server | Fix lead fall dmg config | tr7zw | | +| server | Fix merging spawning values | Mariell Hoversholm | | | server | Fix recipe crash | Ivan Pekov | | | server | Fix the dead lagging the server | William Blake Galbreath | | | server | Fix villager dupe | Ivan Pekov | | @@ -107,6 +108,7 @@ # Patches | server | Remove stream for ender teleport | Sotr | | | server | Remove vanilla profiler callers | Sotr | | | server | Respect PlayerKickEvent leaveMessage | Ivan Pekov | | +| server | Respect rotation when respawning | Ivan Pekov | | | server | Send more packets immediately | MrIvanPlays | | | server | Shutdown Bootstrap thread pool | foss-mc | | | server | Skip events if there's no listeners | William Blake Galbreath | | diff --git a/patches/server/0034-lithium-collision-optimizations.patch b/patches/server/0034-lithium-collision-optimizations.patch index dc736ee3..dfe66dd2 100644 --- a/patches/server/0034-lithium-collision-optimizations.patch +++ b/patches/server/0034-lithium-collision-optimizations.patch @@ -155,7 +155,7 @@ index 0000000000000000000000000000000000000000..20f80ae80de91615ea02f0771f7c020c +} diff --git a/src/main/java/me/jellysquid/mods/lithium/common/entity/LithiumEntityCollisions.java b/src/main/java/me/jellysquid/mods/lithium/common/entity/LithiumEntityCollisions.java new file mode 100644 -index 0000000000000000000000000000000000000000..ef9c294c986df8f1b19df79bdb3f88ab314c561b +index 0000000000000000000000000000000000000000..786cbf11f9699d8e2124a8c6196bc5cf202eb69b --- /dev/null +++ b/src/main/java/me/jellysquid/mods/lithium/common/entity/LithiumEntityCollisions.java @@ -0,0 +1,188 @@ @@ -200,7 +200,7 @@ index 0000000000000000000000000000000000000000..ef9c294c986df8f1b19df79bdb3f88ab + return; + } + -+ Producer.fillList2( ++ Producer.fillList( + getBlockCollisionProducer(world, entity, box), + filled, + (voxelShape, axisAlignedBBS) -> VoxelShapes.addBoxesToIfIntersects(voxelShape, box, axisAlignedBBS) @@ -265,7 +265,7 @@ index 0000000000000000000000000000000000000000..ef9c294c986df8f1b19df79bdb3f88ab + return; + } + -+ Producer.fillList2( ++ Producer.fillList( + getEntityCollisionProducer(view, entity, box.grow(EPSILON), EntityFilter.getFilter(entity), loadChunks), + filled, + (voxelShape, axisAlignedBBS) -> axisAlignedBBS.add(voxelShape.getBoundingBox()) @@ -633,10 +633,10 @@ index 0000000000000000000000000000000000000000..7ed343cfb3130446c85dab2ca04d60f9 +} diff --git a/src/main/java/me/jellysquid/mods/lithium/common/util/Producer.java b/src/main/java/me/jellysquid/mods/lithium/common/util/Producer.java new file mode 100644 -index 0000000000000000000000000000000000000000..e1bd0d9282533b0236eb18c7287e9c0de40a7a6f +index 0000000000000000000000000000000000000000..e563e35089f26a7d76858f99b32440cd2eceabf1 --- /dev/null +++ b/src/main/java/me/jellysquid/mods/lithium/common/util/Producer.java -@@ -0,0 +1,88 @@ +@@ -0,0 +1,67 @@ +package me.jellysquid.mods.lithium.common.util; + +import java.util.List; @@ -675,29 +675,8 @@ index 0000000000000000000000000000000000000000..e1bd0d9282533b0236eb18c7287e9c0d + }, false); + } + -+ static void fillList(Producer producer, List list) { -+ HoldingConsumer consumer = new HoldingConsumer<>(); -+ while (producer.computeNext(consumer)) { -+ T value = consumer.getValue(); -+ if (value == null || list.contains(value)) { continue; } -+ list.add(value); -+ } -+ if (!list.isEmpty()) { -+ boolean allComparable = true; -+ for (T value : list) { -+ if (!(value instanceof Comparable)) { -+ allComparable = false; -+ break; -+ } -+ } -+ if (allComparable) { -+ list.sort((o1, o2) -> ((Comparable)o1).compareTo(o2)); -+ } -+ } -+ } -+ + // WARNING: does not check contains, you have to do that in the add function -+ static void fillList2(Producer producer, List list, BiConsumer> addFunction) { ++ static void fillList(Producer producer, List list, BiConsumer> addFunction) { + HoldingConsumer consumer = new HoldingConsumer<>(); + while (producer.computeNext(consumer)) { + T value = consumer.getValue(); diff --git a/patches/server/0039-Highly-optimize-VillagePlace-filtering.patch b/patches/server/0039-Highly-optimize-VillagePlace-filtering.patch index 43d4fe11..bd85eee1 100644 --- a/patches/server/0039-Highly-optimize-VillagePlace-filtering.patch +++ b/patches/server/0039-Highly-optimize-VillagePlace-filtering.patch @@ -7,6 +7,39 @@ Replaced all streams I could. I expect this to be dropped in the next major release and reimplemented again if mojang changes stuff with villagers again. +diff --git a/src/main/java/me/jellysquid/mods/lithium/common/util/Producer.java b/src/main/java/me/jellysquid/mods/lithium/common/util/Producer.java +index e563e35089f26a7d76858f99b32440cd2eceabf1..343cb58abb3deaf8766ea9bc4e425d40249c5acc 100644 +--- a/src/main/java/me/jellysquid/mods/lithium/common/util/Producer.java ++++ b/src/main/java/me/jellysquid/mods/lithium/common/util/Producer.java +@@ -58,6 +58,28 @@ public interface Producer { + } + } + ++ // also checks contains and is thus only 1 generic ++ static void fillList(Producer producer, List list) { ++ HoldingConsumer consumer = new HoldingConsumer<>(); ++ while (producer.computeNext(consumer)) { ++ T value = consumer.getValue(); ++ if (value == null || list.contains(value)) { continue; } ++ list.add(value); ++ } ++ if (!list.isEmpty()) { ++ boolean allComparable = true; ++ for (T value : list) { ++ if (!(value instanceof Comparable)) { ++ allComparable = false; ++ break; ++ } ++ } ++ if (allComparable) { ++ list.sort((o1, o2) -> ((Comparable)o1).compareTo(o2)); ++ } ++ } ++ } ++ + Producer EMPTY_PRODUCER = consumer -> false; + + @SuppressWarnings("unchecked") diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java index 6fcc7ed7c129e6a33386d65b37cbba4a44e96f0f..e6b5a21c523c598f53207d024322301fbae74825 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java diff --git a/patches/server/0058-Respect-rotation-when-respawning.patch b/patches/server/0058-Respect-rotation-when-respawning.patch new file mode 100644 index 00000000..6ffe60a4 --- /dev/null +++ b/patches/server/0058-Respect-rotation-when-respawning.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ivan Pekov +Date: Mon, 28 Sep 2020 16:23:11 +0300 +Subject: [PATCH] Respect rotation when respawning + + +diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java +index 25186df83c41ae168bca30b28149005f4b9f45e9..95cd25230601d22f02a31667b048bfd1ecda6009 100644 +--- a/src/main/java/net/minecraft/server/PlayerList.java ++++ b/src/main/java/net/minecraft/server/PlayerList.java +@@ -812,7 +812,7 @@ public abstract class PlayerList { + entityplayer1.setRespawnPosition(worldserver1.getDimensionKey(), blockposition, f, flag1, false); + flag2 = !flag && flag3; + isBedSpawn = true; +- location = new Location(worldserver1.getWorld(), vec3d.x, vec3d.y, vec3d.z); ++ location = new Location(worldserver1.getWorld(), vec3d.x, vec3d.y, vec3d.z, f1, 0.0F); // Yatopia - respect rotation + } else if (blockposition != null) { + entityplayer1.playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.a, 0.0F)); + } diff --git a/patches/server/0059-Fix-merging-spawning-values.patch b/patches/server/0059-Fix-merging-spawning-values.patch new file mode 100644 index 00000000..cacbe23f --- /dev/null +++ b/patches/server/0059-Fix-merging-spawning-values.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mariell Hoversholm +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 + } + }