From f703bda6079b244cda098387ceebb93d82868782 Mon Sep 17 00:00:00 2001 From: Helvetica Volubi Date: Thu, 2 Jul 2026 19:39:55 +0800 Subject: [PATCH] Merge 26.1.2 changes to 26.2 branch --- .../0014-Old-leader-zombie-health-logic.patch | 4 +- .../0035-Global-Entities-Counter.patch | 30 ++--- ...eaves-Catch-update-suppression-crash.patch | 112 +++++++++--------- .../features/0039-Instant-Block-Updater.patch | 6 +- .../features/0047-PCA-sync-protocol.patch | 12 +- ...8-Add-Vanilla-like-experience-Config.patch | 91 +++++++------- ...-Restore-vanilla-ender-pearl-loading.patch | 33 +++--- .../bm/lophine/utils/EntitiesCounterUtil.java | 2 +- 8 files changed, 145 insertions(+), 145 deletions(-) diff --git a/lophine-server/minecraft-patches/features/0014-Old-leader-zombie-health-logic.patch b/lophine-server/minecraft-patches/features/0014-Old-leader-zombie-health-logic.patch index d9dceee..1d38385 100644 --- a/lophine-server/minecraft-patches/features/0014-Old-leader-zombie-health-logic.patch +++ b/lophine-server/minecraft-patches/features/0014-Old-leader-zombie-health-logic.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Old leader zombie health logic diff --git a/net/minecraft/world/entity/monster/zombie/Zombie.java b/net/minecraft/world/entity/monster/zombie/Zombie.java -index 2734ffc103ee4760d3521609fdd090ab99df675b..a99683d341f52139003dfa5190ee118d5b06f59f 100644 +index c913cd25cf7a0eb625bc02845bf4af4f7c1a96ab..446559f235df246e7235d2cf507cdbef82349cc4 100644 --- a/net/minecraft/world/entity/monster/zombie/Zombie.java +++ b/net/minecraft/world/entity/monster/zombie/Zombie.java -@@ -597,7 +597,7 @@ public class Zombie extends Monster { +@@ -596,7 +596,7 @@ public class Zombie extends Monster { .addOrReplacePermanentModifier( new AttributeModifier(LEADER_ZOMBIE_BONUS_ID, this.random.nextDouble() * 3.0 + 1.0, AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL) ); diff --git a/lophine-server/minecraft-patches/features/0035-Global-Entities-Counter.patch b/lophine-server/minecraft-patches/features/0035-Global-Entities-Counter.patch index 15da608..d388ac8 100644 --- a/lophine-server/minecraft-patches/features/0035-Global-Entities-Counter.patch +++ b/lophine-server/minecraft-patches/features/0035-Global-Entities-Counter.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Global Entities Counter diff --git a/io/papermc/paper/threadedregions/RegionizedWorldData.java b/io/papermc/paper/threadedregions/RegionizedWorldData.java -index eedbeb005d3c8090333c36b9857c837dfb75dbd4..7ea91dbfb988aff3215a91cf62c9beae94461484 100644 +index 6a90942f4fc3c0b366aadf7a4cead6f684eba1cd..273260d6c0da23a9cf735ccade55c1ef813b7ddc 100644 --- a/io/papermc/paper/threadedregions/RegionizedWorldData.java +++ b/io/papermc/paper/threadedregions/RegionizedWorldData.java @@ -558,6 +558,9 @@ public final class RegionizedWorldData { @@ -35,10 +35,10 @@ index eedbeb005d3c8090333c36b9857c837dfb75dbd4..7ea91dbfb988aff3215a91cf62c9beae this.updateTickData(); } diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java -index 27389ff98942e27c2a877ea5b671caa31353d18c..76fa17ce0afc7ff1c0b2b84aa2baddd2ba18c1a5 100644 +index c3b14503e1bd9025730febc883bead942beb61f7..72c4884e9aebc957333cfedf06c6f49f973828c8 100644 --- a/net/minecraft/server/level/ServerChunkCache.java +++ b/net/minecraft/server/level/ServerChunkCache.java -@@ -513,6 +513,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -511,6 +511,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon this.chunkMap.tick(haveTime); profiler.pop(); this.clearCache(); @@ -65,7 +65,7 @@ index 27389ff98942e27c2a877ea5b671caa31353d18c..76fa17ce0afc7ff1c0b2b84aa2baddd2 } private void tickChunks() { -@@ -577,7 +597,13 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -575,7 +595,13 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon } spawnCookie = NaturalSpawner.createState(chunkCount, regionizedWorldData.getLoadedEntities(), this::getFullChunk, null, true); // Folia - region threading - note: function only cares about loaded entities, doesn't need all } else { @@ -80,7 +80,7 @@ index 27389ff98942e27c2a877ea5b671caa31353d18c..76fa17ce0afc7ff1c0b2b84aa2baddd2 } } finally { foliaProfiler.stopTimer(ca.spottedleaf.leafprofiler.LProfilerRegistry.MOB_SPAWN_ENTITY_COUNT); } // Folia - profiler // Paper end - Optional per player mob spawns -@@ -585,7 +611,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -583,7 +609,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon boolean doMobSpawning = this.level.getGameRules().get(GameRules.SPAWN_MOBS) && !this.level.getLocalPlayers().isEmpty(); // CraftBukkit // Folia - region threading int tickSpeed = this.level.getGameRules().get(GameRules.RANDOM_TICK_SPEED); List spawningCategories; @@ -89,7 +89,7 @@ index 27389ff98942e27c2a877ea5b671caa31353d18c..76fa17ce0afc7ff1c0b2b84aa2baddd2 // Paper start - PlayerNaturallySpawnCreaturesEvent for (ServerPlayer player : this.level.getLocalPlayers()) { // Folia - region threading int chunkRange = Math.min(level.spigotConfig.mobSpawnRange, player.getBukkitEntity().getViewDistance()); -@@ -645,7 +671,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon +@@ -643,7 +669,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon this.level.tickThunder(chunk); } @@ -99,10 +99,10 @@ index 27389ff98942e27c2a877ea5b671caa31353d18c..76fa17ce0afc7ff1c0b2b84aa2baddd2 NaturalSpawner.spawnForChunk(this.level, chunk, spawnCookie, spawningCategories); } diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index a7cebb797973cde399dc30c696b064efd40874f2..1d60c20649b2a6469bfceb5b44c38bfd133e21eb 100644 +index f75249ba1b02efec0f4fc381b02803228e3e1d7c..f4ae59fc4116c0c063effe0c761c69d8c3d33921 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -808,6 +808,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet +@@ -822,6 +822,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet } public void tick(BooleanSupplier haveTime, final io.papermc.paper.threadedregions.TickRegions.TickRegionData region) { // Folia - regionised ticking @@ -114,7 +114,7 @@ index a7cebb797973cde399dc30c696b064efd40874f2..1d60c20649b2a6469bfceb5b44c38bfd final io.papermc.paper.threadedregions.RegionizedWorldData regionizedWorldData = this.getCurrentWorldData(); // Folia - regionised ticking final ca.spottedleaf.leafprofiler.RegionizedProfiler.Handle foliaProfiler = io.papermc.paper.threadedregions.TickRegionScheduler.getProfiler(); // Folia - profiler ProfilerFiller profiler = Profiler.get(); -@@ -2902,6 +2907,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet +@@ -2910,6 +2915,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet public void close() throws IOException { super.close(); //this.entityManager.close(); // Paper - rewrite chunk system @@ -126,7 +126,7 @@ index a7cebb797973cde399dc30c696b064efd40874f2..1d60c20649b2a6469bfceb5b44c38bfd } @Override -@@ -3136,6 +3146,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet +@@ -3139,6 +3149,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet entity.inWorld = true; // CraftBukkit - Mark entity as in world entity.valid = true; // CraftBukkit ServerLevel.this.getChunkSource().addEntity(entity); // Paper - ignore and warn about illegal addEntity calls instead of crashing server @@ -138,7 +138,7 @@ index a7cebb797973cde399dc30c696b064efd40874f2..1d60c20649b2a6469bfceb5b44c38bfd // Paper start - Entity origin API if (entity.origin == null) { entity.origin = entity.position(); -@@ -3151,6 +3166,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet +@@ -3154,6 +3169,11 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet @Override public void onTrackingEnd(final Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity unregister"); // Spigot @@ -151,10 +151,10 @@ index a7cebb797973cde399dc30c696b064efd40874f2..1d60c20649b2a6469bfceb5b44c38bfd // Spigot start // TODO I don't think this is needed anymore if (entity instanceof Player player) { diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java -index fc29654dd7ee3329edf1ccf705f45631d0ecc079..042f026f707e1a75b4ec7dc231e0eeb1b5afacc3 100644 +index e7ebdbb8d77f841551c5ebb0f8e7b4402f6a4751..f3813df2734c9bc1fcecb317b8450ff13b9706dd 100644 --- a/net/minecraft/world/entity/Mob.java +++ b/net/minecraft/world/entity/Mob.java -@@ -813,6 +813,44 @@ public abstract class Mob extends LivingEntity implements Targeting, EquipmentUs +@@ -826,6 +826,44 @@ public abstract class Mob extends LivingEntity implements Targeting, EquipmentUs } } } else { @@ -200,7 +200,7 @@ index fc29654dd7ee3329edf1ccf705f45631d0ecc079..042f026f707e1a75b4ec7dc231e0eeb1 } } diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java -index b3b8160927147468c1dd4a30fac51f96a9d60c9a..cd20d10ee4cd2fe98131c9a93367ae133f96b8d4 100644 +index 500dcbe924fca160bd673592e1aba384f6eb9ed2..0d8d2459457167d78a9a9ea43765980240416947 100644 --- a/net/minecraft/world/level/NaturalSpawner.java +++ b/net/minecraft/world/level/NaturalSpawner.java @@ -121,7 +121,7 @@ public final class NaturalSpawner { @@ -212,7 +212,7 @@ index b3b8160927147468c1dd4a30fac51f96a9d60c9a..cd20d10ee4cd2fe98131c9a93367ae13 return chunk.getNoiseBiome(QuartPos.fromBlock(pos.getX()), QuartPos.fromBlock(pos.getY()), QuartPos.fromBlock(pos.getZ())).value(); } -@@ -628,7 +628,7 @@ public final class NaturalSpawner { +@@ -625,7 +625,7 @@ public final class NaturalSpawner { private @Nullable EntityType lastCheckedType; private double lastCharge; diff --git a/lophine-server/minecraft-patches/features/0036-Leaves-Catch-update-suppression-crash.patch b/lophine-server/minecraft-patches/features/0036-Leaves-Catch-update-suppression-crash.patch index 76aaa1c..9ac7625 100644 --- a/lophine-server/minecraft-patches/features/0036-Leaves-Catch-update-suppression-crash.patch +++ b/lophine-server/minecraft-patches/features/0036-Leaves-Catch-update-suppression-crash.patch @@ -8,10 +8,10 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves) Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/network/PacketProcessor.java b/net/minecraft/network/PacketProcessor.java -index 24f5b890b0126fc817863f99b676da1a548f7608..a25bc31c04778bf12e3b6301ffcfb2275fcc2d90 100644 +index 10fa576838c726d026df078eef6c693d14c2cbda..03c4fab3f9be4f69d8c418e6fdd88211cb1b6ff7 100644 --- a/net/minecraft/network/PacketProcessor.java +++ b/net/minecraft/network/PacketProcessor.java -@@ -106,7 +106,23 @@ public class PacketProcessor implements AutoCloseable { +@@ -105,7 +105,23 @@ public class PacketProcessor implements AutoCloseable { final int packetTimerId = profiler.getOrCreateTimerAndStart(() -> "Packet Handler: ".concat(ListenerAndPacket.this.packet.getClass().getName())); try { // Folia - profiler this.packet.handle(this.listener); } finally { profiler.stopTimer(packetTimerId); } // Folia - profiler @@ -22,9 +22,9 @@ index 24f5b890b0126fc817863f99b676da1a548f7608..a25bc31c04778bf12e3b6301ffcfb227 + } + exception.consume(); + // Lophine end - catch update suppression crash - } catch (Exception var3) { + } catch (Exception e) { + // Lophine start - catch update suppression crash -+ if (var3.getCause() instanceof org.leavesmc.leaves.util.UpdateSuppressionException exception) { ++ if (e.getCause() instanceof org.leavesmc.leaves.util.UpdateSuppressionException exception) { + if (this.listener instanceof net.minecraft.server.network.ServerGamePacketListenerImpl gamePacketListener) { + exception.providePlayer(gamePacketListener.player); + } @@ -32,14 +32,14 @@ index 24f5b890b0126fc817863f99b676da1a548f7608..a25bc31c04778bf12e3b6301ffcfb227 + } + + // Lophine end - catch update suppression crash - if (var3 instanceof ReportedException re && re.getCause() instanceof OutOfMemoryError) { - throw PacketUtils.makeReportedException(var3, this.packet, this.listener); + if (e instanceof ReportedException re && re.getCause() instanceof OutOfMemoryError) { + throw PacketUtils.makeReportedException(e, this.packet, this.listener); } diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java -index f99c02b4d88cea924e20ca8dced67873c83c093f..0c042c4af5d52c08e9fbc03a04c4b696d8a0a7ed 100644 +index 31702272280b853d8a0a688eb162859412f5a646..156bbc6b959ba4902e683ec0c75d9308ed6742f8 100644 --- a/net/minecraft/server/MinecraftServer.java +++ b/net/minecraft/server/MinecraftServer.java -@@ -2019,11 +2019,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop implements ca.spottedleaf.moonrise.patch +@@ -117,7 +117,16 @@ public abstract class StateHolder implements ca.spottedleaf.moonrise.patch if (ret != null) { return ret; } @@ -182,32 +184,32 @@ index b72861c0164ebb13b6fc3e78cd7ce0a2c484f22d..5bf43973c8de8c2f33d384f28fdd0686 } diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java -index 3708f9ffc46a5b1c038c0e7b2ce84802e2b22397..241c43170b5020c1521f43d349813586ba1f69a5 100644 +index 1affb71bb629f5c8923cc2993052c8037ead9798..a71b37b391ceaf1a77b9e184fd37be86b6c818dd 100644 --- a/net/minecraft/world/level/chunk/LevelChunk.java +++ b/net/minecraft/world/level/chunk/LevelChunk.java -@@ -400,6 +400,8 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot - return null; - } else { - Block newBlock = state.getBlock(); -+ // Lophine start - catch update suppression crash -+ try { - this.heightmaps.get(Heightmap.Types.MOTION_BLOCKING).update(localX, y, localZ, state); - this.heightmaps.get(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES).update(localX, y, localZ, state); - this.heightmaps.get(Heightmap.Types.OCEAN_FLOOR).update(localX, y, localZ, state); -@@ -468,6 +470,11 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot - this.markUnsaved(); - return oldState; - } -+ } catch (org.leavesmc.leaves.util.UpdateSuppressionException exception) { -+ exception.provideBlock(this.level, pos, newBlock); -+ throw exception; -+ } -+ // Lophine end - catch update suppression crash - } +@@ -401,6 +401,8 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot } + + Block newBlock = state.getBlock(); ++ // Lophine start - catch update suppression crash ++ try { + this.heightmaps.get(Heightmap.Types.MOTION_BLOCKING).update(localX, y, localZ, state); + this.heightmaps.get(Heightmap.Types.MOTION_BLOCKING_NO_LEAVES).update(localX, y, localZ, state); + this.heightmaps.get(Heightmap.Types.OCEAN_FLOOR).update(localX, y, localZ, state); +@@ -469,6 +471,11 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot + + this.markUnsaved(); + return oldState; ++ } catch (org.leavesmc.leaves.util.UpdateSuppressionException exception) { ++ exception.provideBlock(this.level, pos, newBlock); ++ throw exception; ++ } ++ // Lophine end - catch update suppression crash } + + @Deprecated diff --git a/net/minecraft/world/level/redstone/NeighborUpdater.java b/net/minecraft/world/level/redstone/NeighborUpdater.java -index 9b8d63f69ed1101f1b7b2728690e35165b9aeb99..6358787f3c7dcfa599b2949613236fa8de025096 100644 +index 44dbe6f83c8593c213132feabc7fe27615cb0049..90145a3ea384b568897ee665b80b24cccba1b6c5 100644 --- a/net/minecraft/world/level/redstone/NeighborUpdater.java +++ b/net/minecraft/world/level/redstone/NeighborUpdater.java @@ -87,9 +87,24 @@ public interface NeighborUpdater { @@ -221,17 +223,17 @@ index 9b8d63f69ed1101f1b7b2728690e35165b9aeb99..6358787f3c7dcfa599b2949613236fa8 + // Lophine end - catch update suppression crash level.lastPhysicsProblem = pos.immutable(); // Spigot end - } catch (Throwable var9) { + } catch (Throwable t) { + // Lophine start - catch update suppression crash + if (fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.mergedUpdateSuppressionCrashEnabled()) { -+ if (var9 instanceof org.leavesmc.leaves.util.UpdateSuppressionException exception) { ++ if (t instanceof org.leavesmc.leaves.util.UpdateSuppressionException exception) { + exception.provideBlock(level, pos, changedBlock); + throw exception; + } -+ throw new org.leavesmc.leaves.util.UpdateSuppressionException(pos, level, changedBlock, null, var9); ++ throw new org.leavesmc.leaves.util.UpdateSuppressionException(pos, level, changedBlock, null, t); + } + + // Lophine end - catch update suppression crash - CrashReport report = CrashReport.forThrowable(var9, "Exception while updating neighbours"); + CrashReport report = CrashReport.forThrowable(t, "Exception while updating neighbours"); CrashReportCategory category = report.addCategory("Block being updated"); category.setDetail( diff --git a/lophine-server/minecraft-patches/features/0039-Instant-Block-Updater.patch b/lophine-server/minecraft-patches/features/0039-Instant-Block-Updater.patch index ecaa6ee..6b97add 100644 --- a/lophine-server/minecraft-patches/features/0039-Instant-Block-Updater.patch +++ b/lophine-server/minecraft-patches/features/0039-Instant-Block-Updater.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Instant Block Updater diff --git a/io/papermc/paper/threadedregions/RegionizedWorldData.java b/io/papermc/paper/threadedregions/RegionizedWorldData.java -index 7ea91dbfb988aff3215a91cf62c9beae94461484..491d108cc8e440653746f20fc5b5bca3b791eb88 100644 +index 273260d6c0da23a9cf735ccade55c1ef813b7ddc..bf1aa9f070fac655cdfbe9471947b0111f9252b3 100644 --- a/io/papermc/paper/threadedregions/RegionizedWorldData.java +++ b/io/papermc/paper/threadedregions/RegionizedWorldData.java @@ -506,7 +506,7 @@ public final class RegionizedWorldData { @@ -38,10 +38,10 @@ index 7ea91dbfb988aff3215a91cf62c9beae94461484..491d108cc8e440653746f20fc5b5bca3 \ No newline at end of file +} diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index b884e06a5e9d6a93c548820a99e5d05157e9d128..cb449a5063f7944551c2e66b603c0f910d84e50f 100644 +index e488eb17cac329899b75b329576066da3e0dd5db..46b1fa2b14b1965a6c7e21c011d97ac8bc5064b9 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -1001,11 +1001,15 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet +@@ -1016,11 +1016,15 @@ public class ServerLevel extends Level implements WorldGenLevel, ServerEntityGet // Paper - rewrite chunk system profiler.pop(); profiler.push("debugSynchronizers"); diff --git a/lophine-server/minecraft-patches/features/0047-PCA-sync-protocol.patch b/lophine-server/minecraft-patches/features/0047-PCA-sync-protocol.patch index 37963da..b5bb861 100644 --- a/lophine-server/minecraft-patches/features/0047-PCA-sync-protocol.patch +++ b/lophine-server/minecraft-patches/features/0047-PCA-sync-protocol.patch @@ -8,7 +8,7 @@ As a part of : Leaves (https://github.com/LeavesMC/Leaves/blob/252a16955f6e1e31a Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html) diff --git a/net/minecraft/world/SimpleContainer.java b/net/minecraft/world/SimpleContainer.java -index 049c6ab6472415479435f2caab0444c3cbd33902..d9bb641c07e2e8d3780fadac44ff5e3ee0e35c8b 100644 +index 0f412551685a8ea76be3b389e0782e57d22bb87c..6da0fd10e1a4a346dc1b073563e9bd8cf9b3c76d 100644 --- a/net/minecraft/world/SimpleContainer.java +++ b/net/minecraft/world/SimpleContainer.java @@ -199,6 +199,11 @@ public class SimpleContainer implements Container, StackedContentsCompatible { @@ -24,10 +24,10 @@ index 049c6ab6472415479435f2caab0444c3cbd33902..d9bb641c07e2e8d3780fadac44ff5e3e @Override diff --git a/net/minecraft/world/entity/vehicle/boat/AbstractChestBoat.java b/net/minecraft/world/entity/vehicle/boat/AbstractChestBoat.java -index 8da479d04c04366561549617c477b0811a9b3d7c..345f63ccac2579acf4cf4ee9507c231da12b03ba 100644 +index 58b99596b16e1dd8b0c9bcde5d465c6df52cc28b..3bb07698d1908f310ea7a1bb7a0da531f4040999 100644 --- a/net/minecraft/world/entity/vehicle/boat/AbstractChestBoat.java +++ b/net/minecraft/world/entity/vehicle/boat/AbstractChestBoat.java -@@ -140,6 +140,11 @@ public abstract class AbstractChestBoat extends AbstractBoat implements HasCusto +@@ -142,6 +142,11 @@ public abstract class AbstractChestBoat extends AbstractBoat implements HasCusto @Override public void setChanged() { @@ -40,7 +40,7 @@ index 8da479d04c04366561549617c477b0811a9b3d7c..345f63ccac2579acf4cf4ee9507c231d @Override diff --git a/net/minecraft/world/entity/vehicle/minecart/AbstractMinecartContainer.java b/net/minecraft/world/entity/vehicle/minecart/AbstractMinecartContainer.java -index d2c4b47b2f95c8e6bafc93e436041143e68ffa4f..12938642aa58b6b64d7536575712dc3eadfb6e13 100644 +index d87dcb72fd5d2b22eafc1a444d4fc3807595b6a5..bd92576ec323befd4bc0aaf36cf3c1d03826668a 100644 --- a/net/minecraft/world/entity/vehicle/minecart/AbstractMinecartContainer.java +++ b/net/minecraft/world/entity/vehicle/minecart/AbstractMinecartContainer.java @@ -66,6 +66,11 @@ public abstract class AbstractMinecartContainer extends AbstractMinecart impleme @@ -56,10 +56,10 @@ index d2c4b47b2f95c8e6bafc93e436041143e68ffa4f..12938642aa58b6b64d7536575712dc3e @Override diff --git a/net/minecraft/world/level/block/entity/BlockEntity.java b/net/minecraft/world/level/block/entity/BlockEntity.java -index 5e7612ad30c218fcbb7c9cdd66ecb69d78d8875d..0fa8f720e3b386a5466b3a94d18d5dbbd0d48836 100644 +index f8a6f3d4d6593ec416ce25a72871a5d40352480a..b677a8fec91968ea777b1f38ca00596e9072de92 100644 --- a/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/net/minecraft/world/level/block/entity/BlockEntity.java -@@ -256,6 +256,14 @@ public abstract class BlockEntity implements DebugValueSource, TypedInstance= this.level().paperConfig().collisions.maxEntityCollisions) { + if (this.numCollisions >= (fun.bm.lophine.config.modules.fixes.VanillaLikeExperienceConfig.enabled ? Integer.MAX_VALUE : this.level().paperConfig().collisions.maxEntityCollisions)) { // Lophine - Vanilla-like experience break; } diff --git a/net/minecraft/world/entity/item/FallingBlockEntity.java b/net/minecraft/world/entity/item/FallingBlockEntity.java -index c3f1f875b1adc75f9e9747e148f214e4623a0b4f..04c264611273872a9a33fe2a4d1e2a041e6e78d2 100644 +index 137389f7ee97fc3a15c8f5f87c058065af91264e..dac9eab2eb844ff63353b11c5712cb825d93cf55 100644 --- a/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/net/minecraft/world/entity/item/FallingBlockEntity.java -@@ -383,7 +383,7 @@ public class FallingBlockEntity extends Entity { +@@ -384,7 +384,7 @@ public class FallingBlockEntity extends Entity { ResourceKey oldDimension = this.level().dimension(); boolean fromOrToEnd = (oldDimension == Level.END || newDimension == Level.END) && oldDimension != newDimension; Entity newEntity = super.teleport(transition); @@ -67,10 +60,10 @@ index c3f1f875b1adc75f9e9747e148f214e4623a0b4f..04c264611273872a9a33fe2a4d1e2a04 } } diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java -index 679a941a2af886697fbfcbc7f21e5f4e0ec77dc3..1d4856c477441dd3dc57432c7129fc7f54b528bd 100644 +index 44a5be736ba73c065a5b1a5fffcf2ea4a21d89dd..73ee829e4e67f1e403b78ec39937dd5d37fd304f 100644 --- a/net/minecraft/world/entity/item/ItemEntity.java +++ b/net/minecraft/world/entity/item/ItemEntity.java -@@ -259,7 +259,7 @@ public class ItemEntity extends Entity implements TraceableEntity, ChangePublish +@@ -261,7 +261,7 @@ public class ItemEntity extends Entity implements TraceableEntity, ChangePublish if (this.isMergable()) { double radius = this.level().spigotConfig.itemMerge; // Spigot for (ItemEntity entity : this.level() @@ -80,10 +73,10 @@ index 679a941a2af886697fbfcbc7f21e5f4e0ec77dc3..1d4856c477441dd3dc57432c7129fc7f // Paper start - Fix items merging through walls if (this.level().paperConfig().fixes.fixItemsMergingThroughWalls) { diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java -index 5b5717a886dab57b2fe9ad926a8ae7b3d4f30155..05d8ba6e5a984660be2fba97f9022393bb84f62b 100644 +index 34018a6f7a8c97c489a938222df189e8790d015d..69e663f71a9798c33cc36f6f9341c24a15168760 100644 --- a/net/minecraft/world/entity/item/PrimedTnt.java +++ b/net/minecraft/world/entity/item/PrimedTnt.java -@@ -107,7 +107,7 @@ public class PrimedTnt extends Entity implements TraceableEntity { +@@ -110,7 +110,7 @@ public class PrimedTnt extends Entity implements TraceableEntity { @Override public void tick() { @@ -93,20 +86,20 @@ index 5b5717a886dab57b2fe9ad926a8ae7b3d4f30155..05d8ba6e5a984660be2fba97f9022393 this.applyGravity(); this.move(MoverType.SELF, this.getDeltaMovement()); diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java -index 61ca77cceeacf0c4ebecf3bb66c4eb99c62033d2..fb3651bb6ebc4b75c17c2443dc9f95caeea98ef0 100644 +index 6130c477349096d5912dce859b616661e2f43b36..c8c433dcfef3442ff8385c9fc1f1ea4786b1cddc 100644 --- a/net/minecraft/world/entity/monster/Phantom.java +++ b/net/minecraft/world/entity/monster/Phantom.java -@@ -259,7 +259,7 @@ public class Phantom extends Mob implements Enemy { +@@ -252,7 +252,7 @@ public class Phantom extends Mob implements Enemy { - for (Player player : players) { - if (Phantom.this.canAttack(level, player, TargetingConditions.DEFAULT)) { -- if (!level().paperConfig().entities.behavior.phantomsOnlyAttackInsomniacs || EntitySelector.IS_INSOMNIAC.test(player)) { // Paper - Add phantom creative and insomniac controls -+ if (!level().paperConfig().entities.behavior.phantomsOnlyAttackInsomniacs || fun.bm.lophine.config.modules.fixes.VanillaLikeExperienceConfig.enabled || EntitySelector.IS_INSOMNIAC.test(player)) { // Paper - Add phantom creative and insomniac controls // Lophine - Vanilla-like experience - Phantom.this.setTarget(player, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER); // CraftBukkit - reason - return true; - } // Paper - Add phantom creative and insomniac controls + for (Player player : players) { + if (Phantom.this.canAttack(level, player, TargetingConditions.DEFAULT)) { +- if (!level().paperConfig().entities.behavior.phantomsOnlyAttackInsomniacs || EntitySelector.IS_INSOMNIAC.test(player)) { // Paper - Add phantom creative and insomniac controls ++ if (!level().paperConfig().entities.behavior.phantomsOnlyAttackInsomniacs || fun.bm.lophine.config.modules.fixes.VanillaLikeExperienceConfig.enabled || EntitySelector.IS_INSOMNIAC.test(player)) { // Paper - Add phantom creative and insomniac controls // Lophine - Vanilla-like experience + Phantom.this.setTarget(player, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER); // CraftBukkit - reason + return true; + } // Paper - Add phantom creative and insomniac controls diff --git a/net/minecraft/world/level/NaturalSpawner.java b/net/minecraft/world/level/NaturalSpawner.java -index c99c66563192629e399d1d904cb654c624fe9837..04e4e03399e5484bdbe8695fc2da5e5df152ba34 100644 +index 717cd4b18da2c637fc070c738741f926649b097f..dfb85696affef368d85f93cb0b465abb88267aa1 100644 --- a/net/minecraft/world/level/NaturalSpawner.java +++ b/net/minecraft/world/level/NaturalSpawner.java @@ -90,7 +90,8 @@ public final class NaturalSpawner { @@ -120,7 +113,7 @@ index c99c66563192629e399d1d904cb654c624fe9837..04e4e03399e5484bdbe8695fc2da5e5d entity.spawnReason == org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { continue; diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java -index 69d436268492183ae41fb9a60e61ed1f58a674d9..27e99cdd3a20c8c9177ccf8daa8fdf6984d51318 100644 +index 4f4512d30717e5e41bd98703574485c0e2b866fb..bb9950af265715dab71f2a48011de78961d83677 100644 --- a/net/minecraft/world/level/ServerExplosion.java +++ b/net/minecraft/world/level/ServerExplosion.java @@ -451,7 +451,7 @@ public class ServerExplosion implements Explosion { @@ -133,10 +126,10 @@ index 69d436268492183ae41fb9a60e61ed1f58a674d9..27e99cdd3a20c8c9177ccf8daa8fdf69 if (extension instanceof net.minecraft.world.level.block.piston.PistonMovingBlockEntity blockEntity && blockEntity.isSourcePiston()) { net.minecraft.core.Direction direction = iblockdata.getValue(net.minecraft.world.level.block.piston.PistonHeadBlock.FACING); diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java -index 30f7e8f5e3e9440713e36ee25c90150b6b93c6ff..8527e46cab53ce6e67319cb87e9dcdda6b729de5 100644 +index 64066a091628ad00d914043ae7ecd8bd29d85e5e..4fd9eb9b215c6aa5fdd95e9e961c6f991589d4b9 100644 --- a/net/minecraft/world/level/block/Block.java +++ b/net/minecraft/world/level/block/Block.java -@@ -116,7 +116,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -113,7 +113,7 @@ public class Block extends BlockBehaviour implements ItemLike { private BlockState defaultBlockState; // Paper start - Protect Bedrock and End Portal/Frames from being destroyed public final boolean isDestroyable() { @@ -146,7 +139,7 @@ index 30f7e8f5e3e9440713e36ee25c90150b6b93c6ff..8527e46cab53ce6e67319cb87e9dcdda this != Blocks.BEDROCK && this != Blocks.END_PORTAL_FRAME && diff --git a/net/minecraft/world/level/block/TripWireHookBlock.java b/net/minecraft/world/level/block/TripWireHookBlock.java -index 836eae0c3e0891a3e3309b684f15d65f891215cf..a0fe40351ebb95fd5207bc63be82dbb887baebef 100644 +index b451f8234e92c36fa1395a80b01dc8780824d88e..d1068a7e89c4eee67b997d6424ff1bfc89afff70 100644 --- a/net/minecraft/world/level/block/TripWireHookBlock.java +++ b/net/minecraft/world/level/block/TripWireHookBlock.java @@ -188,7 +188,7 @@ public class TripWireHookBlock extends Block { @@ -159,10 +152,10 @@ index 836eae0c3e0891a3e3309b684f15d65f891215cf..a0fe40351ebb95fd5207bc63be82dbb8 if (canUpdate) { notifyNeighbors(block, level, pos, direction); diff --git a/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -index 62d7a44f139c28a38b14833380e2ec2bf84f3a75..12af97b9ffcf7c0f9e815ccbd81f99a80c6a5819 100644 +index 0bbce88f95c8f96d865f3c58e830e5aa006e48bb..1cf8b71bb636b92df21b2e5027ad3deed8476e80 100644 --- a/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java +++ b/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java -@@ -332,7 +332,7 @@ public class BeehiveBlockEntity extends BlockEntity { +@@ -322,7 +322,7 @@ public class BeehiveBlockEntity extends BlockEntity { iterator.remove(); } // Paper start - Fix bees aging inside; use exitTickCounter to keep actual bee life @@ -172,7 +165,7 @@ index 62d7a44f139c28a38b14833380e2ec2bf84f3a75..12af97b9ffcf7c0f9e815ccbd81f99a8 } // Paper end - Fix bees aging inside; use exitTickCounter to keep actual bee life diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java -index 8066cdcaba8d2fcfa2e9ba3b040a2867dbbc6978..c904e35d49a36e2722295490a5a6aea67f29826e 100644 +index df57ae93f91daf8daed2fef48b685c72f0615763..37c15510d182aa6751827c7ec4d151047101faf8 100644 --- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java +++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java @@ -346,7 +346,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen @@ -185,7 +178,7 @@ index 8066cdcaba8d2fcfa2e9ba3b040a2867dbbc6978..c904e35d49a36e2722295490a5a6aea6 } return false; diff --git a/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/net/minecraft/world/level/block/piston/PistonBaseBlock.java -index a4d8ed890fc6bea1e961df814c00d22ae147734f..da037fbc38b4e605890711f4497ac8755a4f76f0 100644 +index e8f7944220d76d5c9111c6552e7904751aa26018..0c0076dc14cfb07c9de28ec1b2375d0dc4253fe4 100644 --- a/net/minecraft/world/level/block/piston/PistonBaseBlock.java +++ b/net/minecraft/world/level/block/piston/PistonBaseBlock.java @@ -152,7 +152,7 @@ public class PistonBaseBlock extends DirectionalBlock { @@ -197,7 +190,7 @@ index a4d8ed890fc6bea1e961df814c00d22ae147734f..da037fbc38b4e605890711f4497ac875 return false; } // Paper end - Protect Bedrock and End Portal/Frames from being destroyed -@@ -237,7 +237,7 @@ public class PistonBaseBlock extends DirectionalBlock { +@@ -236,7 +236,7 @@ public class PistonBaseBlock extends DirectionalBlock { } else { // Paper start - Protect Bedrock and End Portal/Frames from being destroyed; fix headless pistons breaking blocks BlockPos headPos = pos.relative(direction); @@ -206,17 +199,17 @@ index a4d8ed890fc6bea1e961df814c00d22ae147734f..da037fbc38b4e605890711f4497ac875 level.removeBlock(headPos, false); } else { ((ServerLevel) level).getChunkSource().blockChanged(headPos); // ... fix client desync -@@ -379,7 +379,7 @@ public class PistonBaseBlock extends DirectionalBlock { +@@ -387,7 +387,7 @@ public class PistonBaseBlock extends DirectionalBlock { - for (int i = toPush.size() - 1; i >= 0; i--) { - // Paper start - fix a variety of piston desync dupes -- boolean allowDesync = !fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.tntDupingFix; -+ boolean allowDesync = fun.bm.lophine.config.modules.fixes.VanillaLikeExperienceConfig.enabled || !fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.tntDupingFix; // Lophine - Vanilla-like experience - BlockPos oldPos = toPush.get(i); - BlockPos pos = oldPos; - BlockState blockState = allowDesync ? level.getBlockState(oldPos) : null; + for (int i = toPush.size() - 1; i >= 0; i--) { + // Paper start - fix a variety of piston desync dupes +- boolean allowDesync = !fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.tntDupingFix; ++ boolean allowDesync = fun.bm.lophine.config.modules.fixes.VanillaLikeExperienceConfig.enabled || !fun.bm.lophine.carpet.config.modules.GeneralCompatConfig.tntDupingFix; // Lophine - Vanilla-like experience + BlockPos oldPos = toPush.get(i); + BlockPos pos = oldPos; + BlockState blockState = allowDesync ? level.getBlockState(oldPos) : null; diff --git a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java -index 22663ad55f669081b43644ad2cf1bd4aac48b745..0d79157ac9b7d099c29a933c171fe87718f34f8e 100644 +index 199f23547fded9b7d311b9cf21484d863748fd1c..04e310cdbe22b1d4abfd6d4673551abc5a40d2a9 100644 --- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java +++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java @@ -334,7 +334,7 @@ public class PistonMovingBlockEntity extends BlockEntity { @@ -229,7 +222,7 @@ index 22663ad55f669081b43644ad2cf1bd4aac48b745..0d79157ac9b7d099c29a933c171fe877 } else { if (newState.hasProperty(BlockStateProperties.WATERLOGGED) && newState.getValue(BlockStateProperties.WATERLOGGED)) { diff --git a/net/minecraft/world/level/levelgen/PhantomSpawner.java b/net/minecraft/world/level/levelgen/PhantomSpawner.java -index 142ab133d3b68eb9b88651e307653f1aafdf1de3..6061ac704e504d53492f405e92c17b6a4b44716f 100644 +index ec3a437bd8a7d0e95e1e5fa0ff4462a70391ecf9..007be83486f8b7b921e3bd06abaf02ae6d60b8ea 100644 --- a/net/minecraft/world/level/levelgen/PhantomSpawner.java +++ b/net/minecraft/world/level/levelgen/PhantomSpawner.java @@ -41,7 +41,7 @@ public class PhantomSpawner implements CustomSpawner { @@ -242,7 +235,7 @@ index 142ab133d3b68eb9b88651e307653f1aafdf1de3..6061ac704e504d53492f405e92c17b6a if (!level.dimensionType().hasSkyLight() || playerPos.getY() >= level.getSeaLevel() && level.canSeeSky(playerPos)) { DifficultyInstance difficulty = level.getCurrentDifficultyAt(playerPos); diff --git a/net/minecraft/world/level/portal/PortalForcer.java b/net/minecraft/world/level/portal/PortalForcer.java -index 4e4903d38d705dca6ff16418e54a7a367074aa08..b61259024c167f951d0fad292f40d2a814f6b8a5 100644 +index a468a1013058089115d023e8957f976ae34935ad..a2ba7f683aedb5eadb785db7660dae446e914ab4 100644 --- a/net/minecraft/world/level/portal/PortalForcer.java +++ b/net/minecraft/world/level/portal/PortalForcer.java @@ -233,7 +233,7 @@ public class PortalForcer { diff --git a/lophine-server/minecraft-patches/features/0049-Restore-vanilla-ender-pearl-loading.patch b/lophine-server/minecraft-patches/features/0049-Restore-vanilla-ender-pearl-loading.patch index dd1e1a4..c304ba4 100644 --- a/lophine-server/minecraft-patches/features/0049-Restore-vanilla-ender-pearl-loading.patch +++ b/lophine-server/minecraft-patches/features/0049-Restore-vanilla-ender-pearl-loading.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Restore vanilla ender pearl loading diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index 99e61bbe15430a72096489777a4e417ec5125337..3b76045aa0b4cd97f7b104921a7fa8e29234e1d3 100644 +index 030fcda892780afb931615d948905d594872cf87..b567567379a66e96f5392ea2c735a402cb58b352 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -272,7 +272,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -277,7 +277,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc private @Nullable BlockPos raidOmenPosition; private Vec3 lastKnownClientMovement = Vec3.ZERO; private Input lastClientInput = Input.EMPTY; @@ -17,7 +17,7 @@ index 99e61bbe15430a72096489777a4e417ec5125337..3b76045aa0b4cd97f7b104921a7fa8e2 private long timeEntitySatOnShoulder; private CompoundTag shoulderEntityLeft = new CompoundTag(); private CompoundTag shoulderEntityRight = new CompoundTag(); -@@ -796,18 +796,20 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -785,16 +785,17 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc private void saveEnderPearls(final ValueOutput playerOutput) { if (!this.enderPearls.isEmpty()) { @@ -42,11 +42,16 @@ index 99e61bbe15430a72096489777a4e417ec5125337..3b76045aa0b4cd97f7b104921a7fa8e2 + pearlsOutput.add(pearlTag); } } + } +@@ -1185,6 +1186,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc + ); + } + } + // Lophine end - restore vanilla ender pearl loading on Folia } } -@@ -3598,11 +3600,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -3568,11 +3570,11 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc } public void registerEnderPearl(final ThrownEnderpearl enderPearl) { @@ -61,10 +66,10 @@ index 99e61bbe15430a72096489777a4e417ec5125337..3b76045aa0b4cd97f7b104921a7fa8e2 public Set getEnderPearls() { diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java -index 64779d7b28e61c91897db5226158d65c32bfc835..f665ff0bc9068aaca6d6719ef6f7d87592f39816 100644 +index 36b8cf8c466c9cd4369ceab49e3ac84f224142b8..808e144f4621daf98d1710dac103f970073b16fc 100644 --- a/net/minecraft/server/players/PlayerList.java +++ b/net/minecraft/server/players/PlayerList.java -@@ -752,11 +752,13 @@ public abstract class PlayerList { +@@ -798,11 +798,13 @@ public abstract class PlayerList { player.unRide(); for (ThrownEnderpearl enderpearl : player.getEnderPearls()) { @@ -84,10 +89,10 @@ index 64779d7b28e61c91897db5226158d65c32bfc835..f665ff0bc9068aaca6d6719ef6f7d875 level.removePlayerImmediately(player, Entity.RemovalReason.UNLOADED_WITH_PLAYER); diff --git a/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java b/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java -index dc135f1a5d1ec33195e9ac897aa7acee4cbd13c6..bc9ca4680c18f28b97c4d1afe202cc2fff320daf 100644 +index 7c0a462e6c89e325cbba4d86076b5b84a1f5124d..5b1cd3ab1eb07dc20a249ae86606824005e861a3 100644 --- a/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java +++ b/net/minecraft/world/entity/projectile/throwableitemprojectile/ThrownEnderpearl.java -@@ -29,7 +29,11 @@ import net.minecraft.world.phys.Vec3; +@@ -31,7 +31,11 @@ import net.minecraft.world.phys.Vec3; import org.jspecify.annotations.Nullable; public class ThrownEnderpearl extends ThrowableItemProjectile { @@ -99,17 +104,17 @@ index dc135f1a5d1ec33195e9ac897aa7acee4cbd13c6..bc9ca4680c18f28b97c4d1afe202cc2f public ThrownEnderpearl(final EntityType type, final Level level) { super(type, level); -@@ -37,6 +41,9 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { +@@ -39,6 +43,9 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { public ThrownEnderpearl(final Level level, final LivingEntity mob, final ItemStack itemStack) { - super(EntityType.ENDER_PEARL, mob, level, itemStack); + super(EntityTypes.ENDER_PEARL, mob, level, itemStack); + // Lophine start - restore vanilla ender pearl loading on Folia + this.updateLastSavedEnderPearlTag(); + // Lophine end - restore vanilla ender pearl loading on Folia } @Override -@@ -49,21 +56,73 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { +@@ -51,21 +58,73 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { this.deregisterFromCurrentOwner(); super.setOwner(owner); this.registerToCurrentOwner(); @@ -184,8 +189,8 @@ index dc135f1a5d1ec33195e9ac897aa7acee4cbd13c6..bc9ca4680c18f28b97c4d1afe202cc2f + private static @Nullable Entity findOwnerIncludingDeadPlayer(final ServerLevel serverLevel, final UUID uuid) { Entity owner = serverLevel.getEntityInAnyDimension(uuid); - return (Entity)(owner != null ? owner : serverLevel.getServer().getPlayerList().getPlayer(uuid)); -@@ -281,6 +340,9 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { + return owner != null ? owner : serverLevel.getServer().getPlayerList().getPlayer(uuid); +@@ -283,6 +342,9 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { && owner instanceof ServerPlayer serverPlayer) { this.ticketTimer = serverPlayer.registerAndUpdateEnderPearlTicket(this); } @@ -195,7 +200,7 @@ index dc135f1a5d1ec33195e9ac897aa7acee4cbd13c6..bc9ca4680c18f28b97c4d1afe202cc2f } } else { super.tick(); -@@ -328,6 +390,9 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { +@@ -330,6 +392,9 @@ public class ThrownEnderpearl extends ThrowableItemProjectile { public void onRemoval(final Entity.RemovalReason reason) { if (reason != Entity.RemovalReason.UNLOADED_WITH_PLAYER) { this.deregisterFromCurrentOwner(); diff --git a/lophine-server/src/main/java/fun/bm/lophine/utils/EntitiesCounterUtil.java b/lophine-server/src/main/java/fun/bm/lophine/utils/EntitiesCounterUtil.java index 0d874a7..1d34980 100644 --- a/lophine-server/src/main/java/fun/bm/lophine/utils/EntitiesCounterUtil.java +++ b/lophine-server/src/main/java/fun/bm/lophine/utils/EntitiesCounterUtil.java @@ -205,7 +205,7 @@ public class EntitiesCounterUtil { // Paper start - Optional per player mob spawns if (countMobs) { - chunk.level.getChunkSource().chunkMap.updatePlayerMobTypeMap(entity); + ((ServerLevel) chunk.getLevel()).getChunkSource().chunkMap.updatePlayerMobTypeMap(entity); } // Paper end - Optional per player mob spawns });