From 23c775166e8df5c8ba85b148fb19f08876552dfa Mon Sep 17 00:00:00 2001 From: Samsuik Date: Wed, 29 Oct 2025 21:26:33 +0000 Subject: [PATCH] Updated Upstream (Paper) Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@c7714bb Update PlayerPostRespawnEvent to include full location data (#13237) PaperMC/Paper@9d427a5 [ci skip] Enable unpick (#13241) PaperMC/Paper@13e9c10 [ci skip] Update mache for new unpick definitions PaperMC/Paper@9934c17 Set chunk loading radius to 0 in PlayerSpawnFinder --- gradle.properties | 2 +- sakura-server/build.gradle.kts.patch | 2 +- ...ock-changes-and-level-tick-scheduler.patch | 8 ++-- .../0002-Client-Visibility-Settings.patch | 12 ++--- ...ice-Packet-obfuscation-and-reduction.patch | 8 ++-- .../0007-Store-Entity-Data-State.patch | 6 +-- .../features/0008-Merge-Cannon-Entities.patch | 14 +++--- ...0009-Replace-explosion-density-cache.patch | 16 +++---- .../0013-Add-maxSearch-to-getEntities.patch | 6 +-- ...Collision-limit-for-entity-retrieval.patch | 4 +- .../0015-Explosion-Durable-Blocks.patch | 8 ++-- .../0017-Configure-cannon-physics.patch | 44 +++++++++---------- ...018-Allow-explosions-to-destroy-lava.patch | 8 ++-- .../0021-Legacy-lava-block-formation.patch | 6 +-- .../0025-Optimise-hopper-ticking.patch | 14 +++--- ...anilla-and-eigencraft-redstone-wires.patch | 18 ++++---- ...e-block-counting-for-cannon-entities.patch | 6 +-- .../server/level/ServerPlayer.java.patch | 4 +- .../world/entity/LivingEntity.java.patch | 30 ++++++------- .../world/entity/animal/IronGolem.java.patch | 2 +- .../world/entity/player/Player.java.patch | 26 +++++------ .../AbstractThrownPotion.java.patch | 2 +- .../entity/projectile/FishingHook.java.patch | 4 +- .../world/item/SpawnEggItem.java.patch | 2 +- .../world/level/BaseSpawner.java.patch | 10 ++--- .../minecraft/world/level/Level.java.patch | 8 ++-- .../world/level/block/CactusBlock.java.patch | 2 +- .../level/block/SugarCaneBlock.java.patch | 4 +- .../block/piston/PistonBaseBlock.java.patch | 2 +- .../world/level/material/LavaFluid.java.patch | 2 +- 30 files changed, 140 insertions(+), 140 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7c8ba00..72080b6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=me.samsuik.sakura version=1.21.10-R0.1-SNAPSHOT mcVersion=1.21.10 -paperRef=2a1871bba6d4406c61c872a2977f62e3d8863efc +paperRef=9934c17322980f2f67e2a47d09b08fb8a8a881c6 org.gradle.jvmargs=-Xmx2G org.gradle.vfs.watch=false diff --git a/sakura-server/build.gradle.kts.patch b/sakura-server/build.gradle.kts.patch index 68ae4d0..bbb28d3 100644 --- a/sakura-server/build.gradle.kts.patch +++ b/sakura-server/build.gradle.kts.patch @@ -7,7 +7,7 @@ +val serverBrand = rootProject.name dependencies { - mache("io.papermc:mache:1.21.10+build.7") + mache("io.papermc:mache:1.21.10+build.9") @@ -23,6 +_,17 @@ minecraftVersion = providers.gradleProperty("mcVersion") gitFilePatches = false diff --git a/sakura-server/minecraft-patches/features/0001-Track-block-changes-and-level-tick-scheduler.patch b/sakura-server/minecraft-patches/features/0001-Track-block-changes-and-level-tick-scheduler.patch index b2f2262..fa7203f 100644 --- a/sakura-server/minecraft-patches/features/0001-Track-block-changes-and-level-tick-scheduler.patch +++ b/sakura-server/minecraft-patches/features/0001-Track-block-changes-and-level-tick-scheduler.patch @@ -17,10 +17,10 @@ index cbba36914e41f230f7003539e9ddfba2d570641d..b4b177fd7732960a5cf528e110c8b716 this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 33dfa05d391ed8e6281c733ca5050a58bb32febe..f8ea7e4536f6e0584c65ea9e20fe63f1cc343425 100644 +index 0832a9edc81d6fbf87801dd6ab97c39c3ebbbea3..7cbb9af035092cf2764913c565a3a9398f09e747 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -829,6 +829,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -830,6 +830,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl return chunk != null ? chunk.getNoiseBiome(x, y, z) : this.getUncachedNoiseBiome(x, y, z); } // Paper end - optimise random ticking @@ -32,7 +32,7 @@ index 33dfa05d391ed8e6281c733ca5050a58bb32febe..f8ea7e4536f6e0584c65ea9e20fe63f1 protected Level( WritableLevelData levelData, diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java -index 50a091ab493a7fbc5c457cabd2e26abece5f708a..7d62bc664ec6d26a41571c78ec3229604ac625f5 100644 +index de59760d27280555a334bda4f436164568cffbd6..47c11ffb876019167895b3b4d1a2e455285253b2 100644 --- a/net/minecraft/world/level/chunk/LevelChunk.java +++ b/net/minecraft/world/level/chunk/LevelChunk.java @@ -136,6 +136,16 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot @@ -60,7 +60,7 @@ index 50a091ab493a7fbc5c457cabd2e26abece5f708a..7d62bc664ec6d26a41571c78ec322960 } public LevelChunk(ServerLevel level, ProtoChunk chunk, @Nullable LevelChunk.PostLoadProcessor postLoad) { -@@ -421,6 +432,12 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot +@@ -423,6 +434,12 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot if (!section.getBlockState(i, i1, i2).is(block)) { return null; } else { diff --git a/sakura-server/minecraft-patches/features/0002-Client-Visibility-Settings.patch b/sakura-server/minecraft-patches/features/0002-Client-Visibility-Settings.patch index f1959e0..0b961e2 100644 --- a/sakura-server/minecraft-patches/features/0002-Client-Visibility-Settings.patch +++ b/sakura-server/minecraft-patches/features/0002-Client-Visibility-Settings.patch @@ -166,10 +166,10 @@ index 0a470f95e6c5399b92bf06f3c37fe31d9667acea..ca98972697fe2961402bea4cfb0cf86e } diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index f1eae172241f3d385fb73209c559374b523f9cee..b2bf2cce873a92ea8278468b33c1ba1387ea8f54 100644 +index ae5a2712796a1dd7ac3e3259d4111f01db31c219..3b2b22d709ec924a03134e0118541462a4d966d4 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -473,6 +473,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc +@@ -474,6 +474,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc return this.viewDistanceHolder; } // Paper end - rewrite chunk system @@ -256,10 +256,10 @@ index c6db2c96db96453daaf49779f588f75f7c3d3d60..fd08d04c13a4064c658e0aad436b4883 if (packet.isTerminal()) { this.close(); diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ff07f172951675e163b7b95f64e6a430611fc86d..8d940deeae88dd5bb75c1547ed71b90a72bafd13 100644 +index ef7d44ea1c1582bbf1d544819825778c414fe40d..2c1539826e14698d65a519e2474cbb3a41ed24fa 100644 --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -3221,6 +3221,7 @@ public class ServerGamePacketListenerImpl +@@ -3222,6 +3222,7 @@ public class ServerGamePacketListenerImpl event.setCancelled(cancelled); net.minecraft.world.inventory.AbstractContainerMenu oldContainer = this.player.containerMenu; // SPIGOT-1224 @@ -268,7 +268,7 @@ index ff07f172951675e163b7b95f64e6a430611fc86d..8d940deeae88dd5bb75c1547ed71b90a if (this.player.containerMenu != oldContainer) { this.player.containerMenu.resumeRemoteUpdates(); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index cf89a947e91b8faa6227cb716c947f4099fd16e2..617ee42a38d027eaf662e5a348087351953a22fd 100644 +index 51f970f8e5fcb984e3a62e2322a794ba03325938..5f105b12ab407e6360e23a9aab2b502ced01c996 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -534,6 +534,10 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name @@ -283,7 +283,7 @@ index cf89a947e91b8faa6227cb716c947f4099fd16e2..617ee42a38d027eaf662e5a348087351 public Entity(EntityType type, Level level) { this.type = type; diff --git a/net/minecraft/world/entity/item/FallingBlockEntity.java b/net/minecraft/world/entity/item/FallingBlockEntity.java -index 7b67387d3bb66b1c8ab77e1805c9530a8f1ffa3c..8150b567c05d2c8e87f4b65d616d5c0c01bc2e19 100644 +index 8003dc1c4ecc9b69d92cf0441fe41e3ef8df49c2..85bebec21261e71b82a0b9c02e1c5edd8bd4cde6 100644 --- a/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -79,6 +79,7 @@ public class FallingBlockEntity extends Entity { diff --git a/sakura-server/minecraft-patches/features/0004-Slice-Packet-obfuscation-and-reduction.patch b/sakura-server/minecraft-patches/features/0004-Slice-Packet-obfuscation-and-reduction.patch index 2ece008..fa3da4c 100644 --- a/sakura-server/minecraft-patches/features/0004-Slice-Packet-obfuscation-and-reduction.patch +++ b/sakura-server/minecraft-patches/features/0004-Slice-Packet-obfuscation-and-reduction.patch @@ -153,7 +153,7 @@ index 638432a2e6506d3db6a25c068a33eeafb13cf0d6..c386288e808e97c938f1909d81ebfa00 if (this.entity instanceof LivingEntity) { diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index f5f3eec1ae9348953aee9e44cfb02fc275e30ee6..7f100d8476859bbd1ff654fa8f0cea9d997d8932 100644 +index 28f7af99f290f38c7d0fa0c54dd641a1c9473a45..1b7019c1564fb9fe8f48c3f0983a2c64ea0aa4a5 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -3699,7 +3699,7 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name @@ -166,7 +166,7 @@ index f5f3eec1ae9348953aee9e44cfb02fc275e30ee6..7f100d8476859bbd1ff654fa8f0cea9d } diff --git a/net/minecraft/world/entity/item/FallingBlockEntity.java b/net/minecraft/world/entity/item/FallingBlockEntity.java -index d1f806f950707091d02788117c1f8cffe5b2de04..a4fd6b0a6762ce4d9e488f305dd2abe1e43edbd8 100644 +index 468e08c6ada0554b3af694acad4130ed7ec7b46f..0826565ff322bd1b0cf69c7bac4c9206cf4b9d96 100644 --- a/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -144,7 +144,7 @@ public class FallingBlockEntity extends Entity { @@ -196,10 +196,10 @@ index dd4e2419892a8879106eaaccbf406bec12bbd017..ef61333619d772a3acba6e2f69976550 public int getFuse() { diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java -index 0d19e0c6d8a2a7a26dfb594a2cd8f1a533347690..5f214aaad020552d2db143a1f7a33e8c858731a0 100644 +index c2bb59d6f1babf1e45b2a33a7ed0541e20114f57..3a3afac082e7d7dd2f00cf3633390fb068a7e715 100644 --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -580,7 +580,7 @@ public abstract class Player extends Avatar implements ContainerUser { +@@ -581,7 +581,7 @@ public abstract class Player extends Avatar implements ContainerUser { public void increaseScore(int score) { int score1 = this.getScore(); diff --git a/sakura-server/minecraft-patches/features/0007-Store-Entity-Data-State.patch b/sakura-server/minecraft-patches/features/0007-Store-Entity-Data-State.patch index 8407ee0..fbc698d 100644 --- a/sakura-server/minecraft-patches/features/0007-Store-Entity-Data-State.patch +++ b/sakura-server/minecraft-patches/features/0007-Store-Entity-Data-State.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Store Entity Data/State diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 7f100d8476859bbd1ff654fa8f0cea9d997d8932..a5349e8d2c34c08084635b2f0d3e86315496fc88 100644 +index 1b7019c1564fb9fe8f48c3f0983a2c64ea0aa4a5..b6d65c9ce0fc3c5a27e6de40c3ce26f75bf77426 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -551,6 +551,21 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name @@ -31,10 +31,10 @@ index 7f100d8476859bbd1ff654fa8f0cea9d997d8932..a5349e8d2c34c08084635b2f0d3e8631 public Entity(EntityType type, Level level) { this.type = type; diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index f8ea7e4536f6e0584c65ea9e20fe63f1cc343425..0900ae1072c9dfa70cad0e4f3dc7b916ed96319f 100644 +index 7cbb9af035092cf2764913c565a3a9398f09e747..c51231f40c31b153ac463e31656584e6c70d5a78 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -1448,6 +1448,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1449,6 +1449,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public void guardEntityTick(Consumer action, T entity) { try { diff --git a/sakura-server/minecraft-patches/features/0008-Merge-Cannon-Entities.patch b/sakura-server/minecraft-patches/features/0008-Merge-Cannon-Entities.patch index 71d14c6..45a65ad 100644 --- a/sakura-server/minecraft-patches/features/0008-Merge-Cannon-Entities.patch +++ b/sakura-server/minecraft-patches/features/0008-Merge-Cannon-Entities.patch @@ -41,7 +41,7 @@ index ca98972697fe2961402bea4cfb0cf86ea80a92f0..a42a0672d56e32baaa594c9c1b9db0e7 this.guardEntityTick(this::tickNonPassenger, entity); profilerFiller.pop(); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index a5349e8d2c34c08084635b2f0d3e86315496fc88..a916ef8123fcacf45334b270d4c3e6c98e7aa057 100644 +index b6d65c9ce0fc3c5a27e6de40c3ce26f75bf77426..4a8a7447170731927e82e32f3deca5cb1552b3c2 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -566,6 +566,27 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name @@ -85,7 +85,7 @@ index a5349e8d2c34c08084635b2f0d3e86315496fc88..a916ef8123fcacf45334b270d4c3e6c9 if (!(this instanceof ServerPlayer) && removalReason != RemovalReason.CHANGED_DIMENSION && !alreadyRemoved) { // Players need to be special cased, because they are regularly removed from the world diff --git a/net/minecraft/world/entity/item/FallingBlockEntity.java b/net/minecraft/world/entity/item/FallingBlockEntity.java -index a4fd6b0a6762ce4d9e488f305dd2abe1e43edbd8..cdce0160bc4eeacfd5e7751a0d6d4192d4832c53 100644 +index 0826565ff322bd1b0cf69c7bac4c9206cf4b9d96..208992dcb195ccb495cedfc90cdd5bb2f3e2875b 100644 --- a/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -53,7 +53,7 @@ import net.minecraft.world.phys.HitResult; @@ -165,8 +165,8 @@ index a4fd6b0a6762ce4d9e488f305dd2abe1e43edbd8..cdce0160bc4eeacfd5e7751a0d6d4192 return; } // CraftBukkit end -+ if (this.tryToRespawnEntity()) return; // Sakura - merge cannon entities - if (this.level().setBlock(blockPos, this.blockState, 3)) { ++ if (this.tryToRespawnEntity()) return; // Sakura - merge cannon entities HEAD + if (this.level().setBlock(blockPos, this.blockState, Block.UPDATE_ALL)) { serverLevel.getChunkSource() .chunkMap @@ -345,6 +397,11 @@ public class FallingBlockEntity extends Entity { @@ -280,10 +280,10 @@ index ef61333619d772a3acba6e2f6997655016b399f9..06e2f16032d615bf0083376ce3496941 @Nullable diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 0900ae1072c9dfa70cad0e4f3dc7b916ed96319f..00a0b07aae109203dff96ac4f2aef67f5592c05e 100644 +index c51231f40c31b153ac463e31656584e6c70d5a78..e7ca94521052d45bf42f614b9600f607dd9941fb 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -833,6 +833,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -834,6 +834,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public final me.samsuik.sakura.listener.LevelTickScheduler levelTickScheduler = new me.samsuik.sakura.listener.LevelTickScheduler(this); public final me.samsuik.sakura.listener.BlockChangeTracker blockChangeTracker = new me.samsuik.sakura.listener.BlockChangeTracker(this); // Sakura end - track block changes and tick scheduler @@ -292,7 +292,7 @@ index 0900ae1072c9dfa70cad0e4f3dc7b916ed96319f..00a0b07aae109203dff96ac4f2aef67f protected Level( WritableLevelData levelData, diff --git a/net/minecraft/world/level/block/BasePressurePlateBlock.java b/net/minecraft/world/level/block/BasePressurePlateBlock.java -index 0dc714bf96545bc86cc5cd32849c3be817580d33..2a6e924425b5cf81b28b34ea740f5481d590d829 100644 +index a9c511e7debb8d47125d31291a0867791d9ab41b..6e6d5deea89be952f9ab2743340a165ed114827a 100644 --- a/net/minecraft/world/level/block/BasePressurePlateBlock.java +++ b/net/minecraft/world/level/block/BasePressurePlateBlock.java @@ -92,7 +92,7 @@ public abstract class BasePressurePlateBlock extends Block { diff --git a/sakura-server/minecraft-patches/features/0009-Replace-explosion-density-cache.patch b/sakura-server/minecraft-patches/features/0009-Replace-explosion-density-cache.patch index bd6a641..8db4cb1 100644 --- a/sakura-server/minecraft-patches/features/0009-Replace-explosion-density-cache.patch +++ b/sakura-server/minecraft-patches/features/0009-Replace-explosion-density-cache.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Replace explosion density cache diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index 4bf46b1a7ce64f39ca7d4e915001f54391a3e89c..f698366f23e9064db89b1b9840f198e9963826c5 100644 +index a42a0672d56e32baaa594c9c1b9db0e7487e7d59..60fc3ff0b7ed04a2f71d14658783d150dd92a680 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java @@ -717,6 +717,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -17,10 +17,10 @@ index 4bf46b1a7ce64f39ca7d4e915001f54391a3e89c..f698366f23e9064db89b1b9840f198e9 // Paper start diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 93ff0fdaee21ac493833640b5f620f9bec1a69c8..e807aafed0295d8db7ba0782bb1e462561e9e1ec 100644 +index e7ca94521052d45bf42f614b9600f607dd9941fb..3abf59c6f672e71509bc41e9b30964cf9c2c7e6c 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -834,6 +834,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -835,6 +835,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public final me.samsuik.sakura.listener.BlockChangeTracker blockChangeTracker = new me.samsuik.sakura.listener.BlockChangeTracker(this); // Sakura end - track block changes and tick scheduler public final me.samsuik.sakura.entity.merge.EntityMergeHandler mergeHandler = new me.samsuik.sakura.entity.merge.EntityMergeHandler(); // Sakura - merge cannon entities @@ -98,7 +98,7 @@ index d93a6ed05a09655704e70a7d7ea75ac44e5942e1..950ac55b64ae86a22cfdad6746460283 return blockDensity; diff --git a/net/minecraft/world/level/block/BasePressurePlateBlock.java b/net/minecraft/world/level/block/BasePressurePlateBlock.java -index 2ca8c39c4883ff7f398ed931d560e7cfcf474e1a..6949e2486651280777e785868310ac2c93139f4f 100644 +index 6e6d5deea89be952f9ab2743340a165ed114827a..2af0ea3bda6688ac51124129f0e463c38c667376 100644 --- a/net/minecraft/world/level/block/BasePressurePlateBlock.java +++ b/net/minecraft/world/level/block/BasePressurePlateBlock.java @@ -107,6 +107,11 @@ public abstract class BasePressurePlateBlock extends Block { @@ -110,11 +110,11 @@ index 2ca8c39c4883ff7f398ed931d560e7cfcf474e1a..6949e2486651280777e785868310ac2c + level.densityCache.invalidate(); + } + // Sakura end - explosion density cache - level.setBlock(pos, blockState, 2); + level.setBlock(pos, blockState, Block.UPDATE_CLIENTS); this.updateNeighbours(level, pos); level.setBlocksDirty(pos, state, blockState); diff --git a/net/minecraft/world/level/block/TripWireHookBlock.java b/net/minecraft/world/level/block/TripWireHookBlock.java -index 8a3a8b0fdf9545a41501dc992c6982d9c8ce7b66..5e2576a8b90de8a829c6136cc384f3fe5a49603c 100644 +index 9d53b18c530f19c333dbf3e3ef8beeb8c5c49418..b4ee0485467301cf5e1659cd27efe50362375d59 100644 --- a/net/minecraft/world/level/block/TripWireHookBlock.java +++ b/net/minecraft/world/level/block/TripWireHookBlock.java @@ -168,6 +168,11 @@ public class TripWireHookBlock extends Block { @@ -126,11 +126,11 @@ index 8a3a8b0fdf9545a41501dc992c6982d9c8ce7b66..5e2576a8b90de8a829c6136cc384f3fe + level.densityCache.invalidate(); + } + // Sakura end - explosion density cache - level.setBlock(blockPosx, blockState1.setValue(FACING, opposite), 3); + level.setBlock(blockPosx, blockState1.setValue(FACING, opposite), Block.UPDATE_ALL); notifyNeighbors(block, level, blockPosx, opposite); emitState(level, blockPosx, flag2, flag3, flag, flag1); diff --git a/net/minecraft/world/phys/AABB.java b/net/minecraft/world/phys/AABB.java -index f87d0bd3d65155fbc206a0dae8de67a9184436f3..da90795ce9d4589ee9a4b5ab10f3af59c772547b 100644 +index cffb3b7d480f72cdb9ed535f362fa60f30597523..c2aa62ad0485f02ba0e65a9cf882e2cdf7be460b 100644 --- a/net/minecraft/world/phys/AABB.java +++ b/net/minecraft/world/phys/AABB.java @@ -19,6 +19,30 @@ public class AABB { diff --git a/sakura-server/minecraft-patches/features/0013-Add-maxSearch-to-getEntities.patch b/sakura-server/minecraft-patches/features/0013-Add-maxSearch-to-getEntities.patch index f2d84aa..3f37ba6 100644 --- a/sakura-server/minecraft-patches/features/0013-Add-maxSearch-to-getEntities.patch +++ b/sakura-server/minecraft-patches/features/0013-Add-maxSearch-to-getEntities.patch @@ -83,10 +83,10 @@ index 2d24d03bbdb5ee0d862cbfff2219f58afffafe12..1bf06038d51efcc103fad23670686c30 } } diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index e807aafed0295d8db7ba0782bb1e462561e9e1ec..af39222e08bc7957ac40ea9fd6aae517e7cee45a 100644 +index 3abf59c6f672e71509bc41e9b30964cf9c2c7e6c..a25303e1b5e590b5f5b0f211fd68482cd8232756 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -1728,10 +1728,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1729,10 +1729,18 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl this.getEntities(entityTypeTest, bounds, predicate, output, Integer.MAX_VALUE); } @@ -106,7 +106,7 @@ index e807aafed0295d8db7ba0782bb1e462561e9e1ec..af39222e08bc7957ac40ea9fd6aae517 Profiler.get().incrementCounter("getEntities"); if (entityTypeTest instanceof net.minecraft.world.entity.EntityType byType) { -@@ -1748,7 +1756,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1749,7 +1757,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl if (entityTypeTest == null) { if (maxCount != Integer.MAX_VALUE) { diff --git a/sakura-server/minecraft-patches/features/0014-Use-maxEntityCollision-limit-for-entity-retrieval.patch b/sakura-server/minecraft-patches/features/0014-Use-maxEntityCollision-limit-for-entity-retrieval.patch index 7cf0661..a1aa45e 100644 --- a/sakura-server/minecraft-patches/features/0014-Use-maxEntityCollision-limit-for-entity-retrieval.patch +++ b/sakura-server/minecraft-patches/features/0014-Use-maxEntityCollision-limit-for-entity-retrieval.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use maxEntityCollision limit for entity retrieval diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 70b0604a279b66dc3e1087a03e9e0a1123fb63ee..d238e26628e790b46a36ebcae56e4d900e97b595 100644 +index 6ee6eacf4e71d5a18aa41877ba6e8b732be83555..018d511c0ebc961bf8eca260e1810f74e085eb72 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -3788,7 +3788,17 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin +@@ -3791,7 +3791,17 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin return; } // Paper end - don't run getEntities if we're not going to use its result diff --git a/sakura-server/minecraft-patches/features/0015-Explosion-Durable-Blocks.patch b/sakura-server/minecraft-patches/features/0015-Explosion-Durable-Blocks.patch index 92bf17b..25070e5 100644 --- a/sakura-server/minecraft-patches/features/0015-Explosion-Durable-Blocks.patch +++ b/sakura-server/minecraft-patches/features/0015-Explosion-Durable-Blocks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Explosion Durable Blocks diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java -index dceb2b683064bbf4286c3fe71e0fd0c5a644cb07..40b76310d311a8d4cbe028d575f9220f55e70da2 100644 +index 10530a630e4dbb100eef195944dd3bee7a4e70e1..cb10b9bf4951756e55dac55c24dd2ef741058761 100644 --- a/net/minecraft/world/item/BlockItem.java +++ b/net/minecraft/world/item/BlockItem.java @@ -37,8 +37,30 @@ public class BlockItem extends Item { @@ -40,10 +40,10 @@ index dceb2b683064bbf4286c3fe71e0fd0c5a644cb07..40b76310d311a8d4cbe028d575f9220f return !interactionResult.consumesAction() && context.getItemInHand().has(DataComponents.CONSUMABLE) ? super.use(context.getLevel(), context.getPlayer(), context.getHand()) diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index af39222e08bc7957ac40ea9fd6aae517e7cee45a..1da42c11174bb7eae9a827a17a57d5e7f1d80f09 100644 +index a25303e1b5e590b5f5b0f211fd68482cd8232756..9fe6a8ae7218fa9bdc271353f76ef6a7757d61d5 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -835,6 +835,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -836,6 +836,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl // Sakura end - track block changes and tick scheduler public final me.samsuik.sakura.entity.merge.EntityMergeHandler mergeHandler = new me.samsuik.sakura.entity.merge.EntityMergeHandler(); // Sakura - merge cannon entities public final me.samsuik.sakura.explosion.density.BlockDensityCache densityCache = new me.samsuik.sakura.explosion.density.BlockDensityCache(this); // Sakura - optimise explosion density cache @@ -52,7 +52,7 @@ index af39222e08bc7957ac40ea9fd6aae517e7cee45a..1da42c11174bb7eae9a827a17a57d5e7 protected Level( WritableLevelData levelData, diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java -index 0f95ffa2551289cb74d0210673b942ca90be74d3..976ebf4c62d1cc96f2e147c2240a5886d6b022ed 100644 +index 301c8846d4c77c450d693ab3b42be476ec07dfcc..a27abc419b5e262223da88c6d6c2418dacf5340e 100644 --- a/net/minecraft/world/level/ServerExplosion.java +++ b/net/minecraft/world/level/ServerExplosion.java @@ -133,7 +133,7 @@ public class ServerExplosion implements Explosion { diff --git a/sakura-server/minecraft-patches/features/0017-Configure-cannon-physics.patch b/sakura-server/minecraft-patches/features/0017-Configure-cannon-physics.patch index 20740e1..7a97bec 100644 --- a/sakura-server/minecraft-patches/features/0017-Configure-cannon-physics.patch +++ b/sakura-server/minecraft-patches/features/0017-Configure-cannon-physics.patch @@ -89,10 +89,10 @@ index 82dac4fbaf3572391dad61356ba5351b725194ff..4c18fcd50c79e767bfea908ca6660b66 final PalettedContainer blocks = section.states; diff --git a/net/minecraft/core/dispenser/DispenseItemBehavior.java b/net/minecraft/core/dispenser/DispenseItemBehavior.java -index 703a75c7c6cd05a95afb630973250898dbc7223d..b6ad2d3475ae28103d2bd0fb869da962ba6148ce 100644 +index ef72c5d1b6196582cadb87944f3416881f56c8df..4024bce11a9e6ccc08f6e477ea1c28e6cd704026 100644 --- a/net/minecraft/core/dispenser/DispenseItemBehavior.java +++ b/net/minecraft/core/dispenser/DispenseItemBehavior.java -@@ -471,6 +471,22 @@ public interface DispenseItemBehavior { +@@ -473,6 +473,22 @@ public interface DispenseItemBehavior { } } @@ -128,7 +128,7 @@ index f6e3cc7659175b29b238f7a0ff12f96d035a7b6a..b199cc18e72bfa011f6dc3a7a9e84625 // Paper start diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index f2b9d350f81870c6b9ce0c123573ad2b2762bf8b..0446539327d5c1d1e58b19863dbe08b593e5727c 100644 +index f7253b0a52f7f8eca6741e2ec64dbab3fae109e3..cc249e029be0bba5b3eaa6abc4d423f399a332e4 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -587,6 +587,13 @@ public abstract class Entity implements SyncedDataHolder, DebugValueSource, Name @@ -379,7 +379,7 @@ index f2b9d350f81870c6b9ce0c123573ad2b2762bf8b..0446539327d5c1d1e58b19863dbe08b5 Vec3 vec3 = to.subtract(from); return aabb.collidedAlongVector(vec3, boxes); diff --git a/net/minecraft/world/entity/item/FallingBlockEntity.java b/net/minecraft/world/entity/item/FallingBlockEntity.java -index 00d0cabd7d190e6258b595c372440b0fd06311a4..ce4b253c886aa2afe265d5c38b2799ddda8100bf 100644 +index 0732f1b0e9329165be54c4096a7537cfd28a726a..bd19fe30448147ffa287dcea7a1571082bc2bb76 100644 --- a/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -130,6 +130,25 @@ public class FallingBlockEntity extends Entity implements me.samsuik.sakura.enti @@ -430,10 +430,10 @@ index 00d0cabd7d190e6258b595c372440b0fd06311a4..ce4b253c886aa2afe265d5c38b2799dd state.hasProperty(BlockStateProperties.WATERLOGGED) ? state.setValue(BlockStateProperties.WATERLOGGED, false) : state ); if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(fallingBlockEntity, pos, state.getFluidState().createLegacyBlock())) return fallingBlockEntity; // CraftBukkit -- level.setBlock(pos, state.getFluidState().createLegacyBlock(), 3); +- level.setBlock(pos, state.getFluidState().createLegacyBlock(), Block.UPDATE_ALL); + // Sakura start - configure server mechanics + if (fallingBlockEntity.mechanicsTarget.atLeast(me.samsuik.sakura.mechanics.MechanicVersion.v1_18_2)) { -+ level.setBlock(pos, state.getFluidState().createLegacyBlock(), 3); ++ level.setBlock(pos, state.getFluidState().createLegacyBlock(), Block.UPDATE_ALL); + } + // Sakura end - configure server mechanics level.addFreshEntity(fallingBlockEntity); @@ -685,10 +685,10 @@ index 867846ce62ffc5440d07084c79b2dd752bbe82c9..bf232ac4a4933c125535f8ea959d07fb return false; } else { diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 807d88528e22117b7fb4090c859c48e38c8be385..5a8826584fd02886a9ffc624c61ad26086f07a80 100644 +index 9fe6a8ae7218fa9bdc271353f76ef6a7757d61d5..d86e523ba9a3f99337dcb11a56f0eaa04da95e0a 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -836,6 +836,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -837,6 +837,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public final me.samsuik.sakura.entity.merge.EntityMergeHandler mergeHandler = new me.samsuik.sakura.entity.merge.EntityMergeHandler(); // Sakura - merge cannon entities public final me.samsuik.sakura.explosion.density.BlockDensityCache densityCache = new me.samsuik.sakura.explosion.density.BlockDensityCache(this); // Sakura - optimise explosion density cache public final me.samsuik.sakura.explosion.durable.DurableBlockManager durabilityManager = new me.samsuik.sakura.explosion.durable.DurableBlockManager(); // Sakura - explosion durable blocks @@ -845,7 +845,7 @@ index 24b9ce38bc144febeefc2304242e96243533a01c..ecd93719347d21b9d1dbe6515e1be873 protected void tick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) { if (isFree(level.getBlockState(pos.below())) && pos.getY() >= level.getMinY()) { diff --git a/net/minecraft/world/level/block/FenceGateBlock.java b/net/minecraft/world/level/block/FenceGateBlock.java -index 0c6ae65fc58d63a0b80f3bc1ffa0c9a1bb33de83..f291dc3b3f3e3b8da221f42580ed26c4b8f569a7 100644 +index 6845b2ec65f50bc29c53632a3105ced6761e5f8f..06b320217b7d6c332125bf1b449889851ed3fb1a 100644 --- a/net/minecraft/world/level/block/FenceGateBlock.java +++ b/net/minecraft/world/level/block/FenceGateBlock.java @@ -210,8 +210,15 @@ public class FenceGateBlock extends HorizontalDirectionalBlock { @@ -853,7 +853,7 @@ index 0c6ae65fc58d63a0b80f3bc1ffa0c9a1bb33de83..f291dc3b3f3e3b8da221f42580ed26c4 } // CraftBukkit end - if (state.getValue(POWERED) != hasNeighborSignal) { -- level.setBlock(pos, state.setValue(POWERED, hasNeighborSignal).setValue(OPEN, hasNeighborSignal), 2); +- level.setBlock(pos, state.setValue(POWERED, hasNeighborSignal).setValue(OPEN, hasNeighborSignal), Block.UPDATE_CLIENTS); + // Sakura start - configure server mechanics + final boolean pre1_10_0 = level.localConfig().at(pos).mechanicsTarget.before(me.samsuik.sakura.mechanics.MechanicVersion.v1_10); + final boolean powered = state.getValue(POWERED); @@ -861,16 +861,16 @@ index 0c6ae65fc58d63a0b80f3bc1ffa0c9a1bb33de83..f291dc3b3f3e3b8da221f42580ed26c4 + final boolean openGate = pre1_10_0 && (hasNeighborSignal == powered || state.getValue(OPEN) != powered) + ? state.getValue(OPEN) + : hasNeighborSignal; -+ level.setBlock(pos, state.setValue(POWERED, hasNeighborSignal).setValue(OPEN, openGate), 2); ++ level.setBlock(pos, state.setValue(POWERED, hasNeighborSignal).setValue(OPEN, openGate), Block.UPDATE_CLIENTS); + // Sakura end - configure server mechanics if (state.getValue(OPEN) != hasNeighborSignal) { level.playSound( null, diff --git a/net/minecraft/world/level/block/HoneyBlock.java b/net/minecraft/world/level/block/HoneyBlock.java -index 25dd5b720d868f89d1e68acc391aff74f3accbe1..e744681f645ef7045ecab264c15f6be0f189831d 100644 +index 138708e61c1f75d01d8982f391edda04b54cf16d..e492ee4277e230dbb723042a3e12977d76c5ac81 100644 --- a/net/minecraft/world/level/block/HoneyBlock.java +++ b/net/minecraft/world/level/block/HoneyBlock.java -@@ -71,11 +71,19 @@ public class HoneyBlock extends HalfTransparentBlock { +@@ -72,11 +72,19 @@ public class HoneyBlock extends HalfTransparentBlock { super.entityInside(state, level, pos, entity, effectApplier, pastEdges); } @@ -892,7 +892,7 @@ index 25dd5b720d868f89d1e68acc391aff74f3accbe1..e744681f645ef7045ecab264c15f6be0 return (deltaY - 0.08) * 0.98F; } -@@ -84,7 +92,7 @@ public class HoneyBlock extends HalfTransparentBlock { +@@ -85,7 +93,7 @@ public class HoneyBlock extends HalfTransparentBlock { return false; } else if (entity.getY() > pos.getY() + 0.9375 - 1.0E-7) { return false; @@ -901,7 +901,7 @@ index 25dd5b720d868f89d1e68acc391aff74f3accbe1..e744681f645ef7045ecab264c15f6be0 return false; } else { double abs = Math.abs(pos.getX() + 0.5 - entity.getX()); -@@ -102,11 +110,13 @@ public class HoneyBlock extends HalfTransparentBlock { +@@ -103,11 +111,13 @@ public class HoneyBlock extends HalfTransparentBlock { private void doSlideMovement(Entity entity) { Vec3 deltaMovement = entity.getDeltaMovement(); @@ -952,7 +952,7 @@ index b895dbe24fb567d1161107b944a24a325967c061..c761d15236c0f78eeca26d0a828866fd } diff --git a/net/minecraft/world/level/block/LiquidBlock.java b/net/minecraft/world/level/block/LiquidBlock.java -index 3a432dc812579c19e1982126b5cfd003814e0dcf..4449addb934033776558e5c549c66da9551201fc 100644 +index cba3ce458fb08064237c979959c237c26c80a04c..802128ea74a6a5250762dd8501352dda7f18543d 100644 --- a/net/minecraft/world/level/block/LiquidBlock.java +++ b/net/minecraft/world/level/block/LiquidBlock.java @@ -201,7 +201,14 @@ public class LiquidBlock extends Block implements BucketPickup { @@ -972,7 +972,7 @@ index 3a432dc812579c19e1982126b5cfd003814e0dcf..4449addb934033776558e5c549c66da9 if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(level, pos, block.defaultBlockState(), 3)) { this.fizz(level, pos); diff --git a/net/minecraft/world/level/block/RedStoneWireBlock.java b/net/minecraft/world/level/block/RedStoneWireBlock.java -index fc75ecd9f56526b213b348d1243834eb21abfc34..9720c55536d09377d1fbcbf1af4acb3caa9952f2 100644 +index 1329557b36d9b1eb70930dff6b01352dbb89f9c1..96e3e0e92c7179bdf1e576cd90f4e4370fb26de7 100644 --- a/net/minecraft/world/level/block/RedStoneWireBlock.java +++ b/net/minecraft/world/level/block/RedStoneWireBlock.java @@ -322,6 +322,10 @@ public class RedStoneWireBlock extends Block { @@ -1049,10 +1049,10 @@ index 9f013b6a87a18f83188d6efec9f84d8895876f24..a091246071719aeaad3ec4f6beb4cfd1 } diff --git a/net/minecraft/world/level/block/piston/PistonBaseBlock.java b/net/minecraft/world/level/block/piston/PistonBaseBlock.java -index 4bf4c3a8dcdcb9c6b8d722d05f7cb7fbfb78ddef..7012f90689592600bab03060c2c45bd45cc079ff 100644 +index 9db036f2aeaa2c46551e5d2e4385fa4c79b035ea..61294a04dbb09751cf25835b25c3f411f16ba050 100644 --- a/net/minecraft/world/level/block/piston/PistonBaseBlock.java +++ b/net/minecraft/world/level/block/piston/PistonBaseBlock.java -@@ -122,6 +122,11 @@ public class PistonBaseBlock extends DirectionalBlock { +@@ -123,6 +123,11 @@ public class PistonBaseBlock extends DirectionalBlock { i = 2; } @@ -1101,7 +1101,7 @@ index 8c35c7e54373f8be187a84bd4b4a9ce9d6341dff..bd7c33204a430a862e8abd2683afd92c } diff --git a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java -index a50f572ef71a133fa29a5d967a26477218431762..61f48991232be5b32472c97073c8990cce8706a9 100644 +index 9383e91846e1119dc11259235f586e9e25c7e51a..6973d307a250d8ef1632fa630a0f8a12e08bf926 100644 --- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java +++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java @@ -64,6 +64,165 @@ public class PistonMovingBlockEntity extends BlockEntity { @@ -1343,10 +1343,10 @@ index a50f572ef71a133fa29a5d967a26477218431762..61f48991232be5b32472c97073c8990c } diff --git a/net/minecraft/world/level/material/LavaFluid.java b/net/minecraft/world/level/material/LavaFluid.java -index 7449be23b48c2b08415e2de97348ec24b99395cc..f383c6b8f1aefb66fc4a0c54c895a700e7c62f62 100644 +index 1d76aa65ae85d517eec54fea8c1234bed1807514..d413d4999f265f88a50133811735237902843e55 100644 --- a/net/minecraft/world/level/material/LavaFluid.java +++ b/net/minecraft/world/level/material/LavaFluid.java -@@ -185,6 +185,11 @@ public abstract class LavaFluid extends FlowingFluid { +@@ -187,6 +187,11 @@ public abstract class LavaFluid extends FlowingFluid { @Override public boolean canBeReplacedWith(FluidState fluidState, BlockGetter level, BlockPos pos, Fluid fluid, Direction direction) { diff --git a/sakura-server/minecraft-patches/features/0018-Allow-explosions-to-destroy-lava.patch b/sakura-server/minecraft-patches/features/0018-Allow-explosions-to-destroy-lava.patch index 6c4894b..1cda4cb 100644 --- a/sakura-server/minecraft-patches/features/0018-Allow-explosions-to-destroy-lava.patch +++ b/sakura-server/minecraft-patches/features/0018-Allow-explosions-to-destroy-lava.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow explosions to destroy lava diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java -index a24e728476a64e49f2e5139fc103e19d5650d6e1..8317c1d8ede33a1de115c5597a439f30284c8b86 100644 +index 1070ad18c1d9441f7fa38a06541e54ccb2ddd63f..c9845e8d486b30c275ebe7585aefb9b1064f33d2 100644 --- a/net/minecraft/world/level/ServerExplosion.java +++ b/net/minecraft/world/level/ServerExplosion.java @@ -373,6 +373,11 @@ public class ServerExplosion implements Explosion { @@ -21,15 +21,15 @@ index a24e728476a64e49f2e5139fc103e19d5650d6e1..8317c1d8ede33a1de115c5597a439f30 return this.damageCalculator.getBlockExplosionResistance(this, this.level, pos, blockState, fluidState); diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java -index dff1c4fa389d5168bd9ec1aff4c7e4bc63c4110e..7ee94845b69139f7c419b9d6ee24ba1db0e69975 100644 +index d31da50baeb7f47f0e1d81ee3c05023370df8cd3..151ceb365d9ae8f27f3e182ab8150f4e3c9e9110 100644 --- a/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/net/minecraft/world/level/block/state/BlockBehaviour.java @@ -200,7 +200,7 @@ public abstract class BlockBehaviour implements FeatureElement { state.getDrops(builder).forEach(stack -> dropConsumer.accept(stack, pos)); } -- level.setBlock(pos, Blocks.AIR.defaultBlockState(), 3); -+ level.setBlock(pos, Blocks.AIR.defaultBlockState(), level.sakuraConfig().cannons.explosion.explodeLava && state.is(Blocks.LAVA) ? 2 : 3); // Sakura - allow explosions to destroy lava; don't cause block updates when blowing up lava +- level.setBlock(pos, Blocks.AIR.defaultBlockState(), Block.UPDATE_ALL); ++ level.setBlock(pos, Blocks.AIR.defaultBlockState(), level.sakuraConfig().cannons.explosion.explodeLava && state.is(Blocks.LAVA) ? Block.UPDATE_CLIENTS : Block.UPDATE_ALL); // Sakura - allow explosions to destroy lava; don't cause block updates when blowing up lava block.wasExploded(level, pos, explosion); } } diff --git a/sakura-server/minecraft-patches/features/0021-Legacy-lava-block-formation.patch b/sakura-server/minecraft-patches/features/0021-Legacy-lava-block-formation.patch index 46951a9..96b667c 100644 --- a/sakura-server/minecraft-patches/features/0021-Legacy-lava-block-formation.patch +++ b/sakura-server/minecraft-patches/features/0021-Legacy-lava-block-formation.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Legacy lava block formation diff --git a/net/minecraft/world/level/block/LiquidBlock.java b/net/minecraft/world/level/block/LiquidBlock.java -index 4449addb934033776558e5c549c66da9551201fc..5a26411c8b5927ca2960830ad29a4aa9954704e8 100644 +index 802128ea74a6a5250762dd8501352dda7f18543d..682b9108c70ff2dc963a5574f05f1c5d124354c6 100644 --- a/net/minecraft/world/level/block/LiquidBlock.java +++ b/net/minecraft/world/level/block/LiquidBlock.java @@ -204,7 +204,14 @@ public class LiquidBlock extends Block implements BucketPickup { @@ -25,10 +25,10 @@ index 4449addb934033776558e5c549c66da9551201fc..5a26411c8b5927ca2960830ad29a4aa9 return true; } diff --git a/net/minecraft/world/level/material/LavaFluid.java b/net/minecraft/world/level/material/LavaFluid.java -index f383c6b8f1aefb66fc4a0c54c895a700e7c62f62..790dc2a5c94ab7c54b8b95c5a2c9742604395c1e 100644 +index d413d4999f265f88a50133811735237902843e55..6eb6a3dd77a554c2b938b59a905a73b750880563 100644 --- a/net/minecraft/world/level/material/LavaFluid.java +++ b/net/minecraft/world/level/material/LavaFluid.java -@@ -185,9 +185,16 @@ public abstract class LavaFluid extends FlowingFluid { +@@ -187,9 +187,16 @@ public abstract class LavaFluid extends FlowingFluid { @Override public boolean canBeReplacedWith(FluidState fluidState, BlockGetter level, BlockPos pos, Fluid fluid, Direction direction) { diff --git a/sakura-server/minecraft-patches/features/0025-Optimise-hopper-ticking.patch b/sakura-server/minecraft-patches/features/0025-Optimise-hopper-ticking.patch index fb7554d..46d608d 100644 --- a/sakura-server/minecraft-patches/features/0025-Optimise-hopper-ticking.patch +++ b/sakura-server/minecraft-patches/features/0025-Optimise-hopper-ticking.patch @@ -42,10 +42,10 @@ index 8e6f097b4d17aaaf8eccc16e11ce2bd01ad63322..4baa578a2d277676647ca60487a104f8 boolean isEmpty(); diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 5a8826584fd02886a9ffc624c61ad26086f07a80..037afee0806646ae813bc4f067f4d7600d624b18 100644 +index d86e523ba9a3f99337dcb11a56f0eaa04da95e0a..e6d6f98627884bd4ecb1266320bc745b34dea344 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -1435,7 +1435,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -1436,7 +1436,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl // Spigot end if (tickingBlockEntity.isRemoved()) { toRemove.add(tickingBlockEntity); // Paper - Fix MC-117075; use removeAll @@ -55,7 +55,7 @@ index 5a8826584fd02886a9ffc624c61ad26086f07a80..037afee0806646ae813bc4f067f4d760 // Paper start - rewrite chunk system if ((++tickedEntities & 7) == 0) { diff --git a/net/minecraft/world/level/block/HopperBlock.java b/net/minecraft/world/level/block/HopperBlock.java -index 2a6d5790ac3bc4984937c5b6d70f8f49f2c59116..bc247852e06ca4b488cdb6a44051dc7733ce0fdd 100644 +index 3140269761935201882173e568004488147a4110..bc1dd75b8ef078713eeb1e131a18edf8122bb520 100644 --- a/net/minecraft/world/level/block/HopperBlock.java +++ b/net/minecraft/world/level/block/HopperBlock.java @@ -121,6 +121,12 @@ public class HopperBlock extends BaseEntityBlock { @@ -68,7 +68,7 @@ index 2a6d5790ac3bc4984937c5b6d70f8f49f2c59116..bc247852e06ca4b488cdb6a44051dc77 + hbe.setBlockEntityTicking(flag); + } + // Sakura end - optimise hopper ticking - level.setBlock(pos, state.setValue(ENABLED, flag), 2); + level.setBlock(pos, state.setValue(ENABLED, flag), Block.UPDATE_CLIENTS); } } diff --git a/net/minecraft/world/level/block/entity/BlockEntity.java b/net/minecraft/world/level/block/entity/BlockEntity.java @@ -287,10 +287,10 @@ index 28e3b73507b988f7234cbf29c4024c88180d0aef..a0d247aa883553708c4b921582324255 + // Sakura end - optimise hopper ticking } diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java -index 7d62bc664ec6d26a41571c78ec3229604ac625f5..a0afed8dcf0c215ba3f79d6dbff1eb55c97dac15 100644 +index 47c11ffb876019167895b3b4d1a2e455285253b2..0e3b46adf54a6d68ad5b809c92b5cc13a7cdbf57 100644 --- a/net/minecraft/world/level/chunk/LevelChunk.java +++ b/net/minecraft/world/level/chunk/LevelChunk.java -@@ -1017,6 +1017,13 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot +@@ -1019,6 +1019,13 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot return BlockEntityType.getKey(this.blockEntity.getType()).toString(); } @@ -304,7 +304,7 @@ index 7d62bc664ec6d26a41571c78ec3229604ac625f5..a0afed8dcf0c215ba3f79d6dbff1eb55 @Override public String toString() { return "Level ticker for " + this.getType() + "@" + this.getPos(); -@@ -1065,6 +1072,13 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot +@@ -1067,6 +1074,13 @@ public class LevelChunk extends ChunkAccess implements DebugValueSource, ca.spot return this.ticker.getType(); } diff --git a/sakura-server/minecraft-patches/features/0028-Cache-vanilla-and-eigencraft-redstone-wires.patch b/sakura-server/minecraft-patches/features/0028-Cache-vanilla-and-eigencraft-redstone-wires.patch index 2a23f4f..1582f32 100644 --- a/sakura-server/minecraft-patches/features/0028-Cache-vanilla-and-eigencraft-redstone-wires.patch +++ b/sakura-server/minecraft-patches/features/0028-Cache-vanilla-and-eigencraft-redstone-wires.patch @@ -45,10 +45,10 @@ index e7e5932235a4af05106e87a48f3df261fc33d96b..92d315bcb54a0b72dc0befc6550cc461 // Paper start diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 037afee0806646ae813bc4f067f4d7600d624b18..378a88bbb605e22c74e5f2eea30dd9a3431c2c12 100644 +index e6d6f98627884bd4ecb1266320bc745b34dea344..45a50997c34562facb20c311d2d88a5fa4f4f670 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -837,6 +837,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -838,6 +838,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl public final me.samsuik.sakura.explosion.density.BlockDensityCache densityCache = new me.samsuik.sakura.explosion.density.BlockDensityCache(this); // Sakura - optimise explosion density cache public final me.samsuik.sakura.explosion.durable.DurableBlockManager durabilityManager = new me.samsuik.sakura.explosion.durable.DurableBlockManager(); // Sakura - explosion durable blocks public final me.samsuik.sakura.entity.dispensing.DispenseRelocationHandler dispenseRelocationHandler = new me.samsuik.sakura.entity.dispensing.DispenseRelocationHandler(this); // Sakura - configure server mechanics @@ -57,7 +57,7 @@ index 037afee0806646ae813bc4f067f4d7600d624b18..378a88bbb605e22c74e5f2eea30dd9a3 protected Level( WritableLevelData levelData, diff --git a/net/minecraft/world/level/block/RedStoneWireBlock.java b/net/minecraft/world/level/block/RedStoneWireBlock.java -index 9720c55536d09377d1fbcbf1af4acb3caa9952f2..e69c17a02c88b5206b211ef6421f291657768a25 100644 +index 96e3e0e92c7179bdf1e576cd90f4e4370fb26de7..58e5df3bef82cbae868fa680277aeb12b3f45975 100644 --- a/net/minecraft/world/level/block/RedStoneWireBlock.java +++ b/net/minecraft/world/level/block/RedStoneWireBlock.java @@ -306,6 +306,12 @@ public class RedStoneWireBlock extends Block { @@ -108,7 +108,7 @@ index 9720c55536d09377d1fbcbf1af4acb3caa9952f2..e69c17a02c88b5206b211ef6421f2916 : powerValue; } diff --git a/net/minecraft/world/level/block/state/BlockBehaviour.java b/net/minecraft/world/level/block/state/BlockBehaviour.java -index f7cebfc66e65ae4e247d60eb7291309a3454184d..a0d7fefaea33a2eb599bc162b26dd89df053a7dd 100644 +index 151ceb365d9ae8f27f3e182ab8150f4e3c9e9110..d4381935c85392cf09b968eb6b6195ad736352f3 100644 --- a/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/net/minecraft/world/level/block/state/BlockBehaviour.java @@ -524,6 +524,13 @@ public abstract class BlockBehaviour implements FeatureElement { @@ -160,10 +160,10 @@ index 5d17213a692016d2f005c7820bf2cf1f42ce411f..6e0a41bd6c171b37476cedb57d6dcbdb this.addedThisLayer.clear(); this.count = 0; diff --git a/net/minecraft/world/level/redstone/DefaultRedstoneWireEvaluator.java b/net/minecraft/world/level/redstone/DefaultRedstoneWireEvaluator.java -index abcc144a086a45bf4cfa4d1a33e2ae10952e0da2..5cd635ca6c215dde0fd979dd7dbaa9edea957a20 100644 +index 4edf6e96cd47ab75aedd4baefcf49cd3fae00d7a..25041865bc4dbb17ed9655834af567dfc4ca94ee 100644 --- a/net/minecraft/world/level/redstone/DefaultRedstoneWireEvaluator.java +++ b/net/minecraft/world/level/redstone/DefaultRedstoneWireEvaluator.java -@@ -27,7 +27,14 @@ public class DefaultRedstoneWireEvaluator extends RedstoneWireEvaluator { +@@ -28,7 +28,14 @@ public class DefaultRedstoneWireEvaluator extends RedstoneWireEvaluator { } if (oldPower != i) { // CraftBukkit end @@ -175,10 +175,10 @@ index abcc144a086a45bf4cfa4d1a33e2ae10952e0da2..5cd635ca6c215dde0fd979dd7dbaa9ed if (level.getBlockState(pos) == state) { + wireCache.trackWirePower(pos, i, oldPower); + // Sakura end - cache vanilla and eigencraft wires - level.setBlock(pos, state.setValue(RedStoneWireBlock.POWER, i), 2); + level.setBlock(pos, state.setValue(RedStoneWireBlock.POWER, i), Block.UPDATE_CLIENTS); } -@@ -39,6 +46,7 @@ public class DefaultRedstoneWireEvaluator extends RedstoneWireEvaluator { +@@ -40,6 +47,7 @@ public class DefaultRedstoneWireEvaluator extends RedstoneWireEvaluator { } for (BlockPos blockPos : set) { @@ -187,7 +187,7 @@ index abcc144a086a45bf4cfa4d1a33e2ae10952e0da2..5cd635ca6c215dde0fd979dd7dbaa9ed } } diff --git a/net/minecraft/world/level/redstone/NeighborUpdater.java b/net/minecraft/world/level/redstone/NeighborUpdater.java -index 3f4b17a222fdbf97ca8979a43f1f231d9e9d8ddb..42705f342c3594d4a327eb2aa169ee59cd87f13d 100644 +index f45cf0136e77ed5a903d033a7b0611e5edc23db9..e4057d364894bcab766a0ef444a9d54ed20e8822 100644 --- a/net/minecraft/world/level/redstone/NeighborUpdater.java +++ b/net/minecraft/world/level/redstone/NeighborUpdater.java @@ -17,6 +17,12 @@ import net.minecraft.world.level.block.state.BlockState; diff --git a/sakura-server/minecraft-patches/features/0030-Optimise-block-counting-for-cannon-entities.patch b/sakura-server/minecraft-patches/features/0030-Optimise-block-counting-for-cannon-entities.patch index 5fefdca..f818ce3 100644 --- a/sakura-server/minecraft-patches/features/0030-Optimise-block-counting-for-cannon-entities.patch +++ b/sakura-server/minecraft-patches/features/0030-Optimise-block-counting-for-cannon-entities.patch @@ -42,10 +42,10 @@ index 5d95d8747c4816d27bab6455b3bdfb7b50ae265f..079e887cac1a903af23c1a9ace47b9e3 for (int currY = minYIterate; currY <= maxYIterate; ++currY) { final int blockY = currY | (currChunkY << 4); diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java -index 378a88bbb605e22c74e5f2eea30dd9a3431c2c12..ac83b2d1b0a7973fc128cf8b54421d5c8393405b 100644 +index 45a50997c34562facb20c311d2d88a5fa4f4f670..025502d3b5e8d61fb048fe2859eeb613faa8b68b 100644 --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -621,6 +621,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -622,6 +622,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl BlockPos selected = null; double selectedDistance = Double.MAX_VALUE; final Vec3 entityPos = entity.position(); @@ -53,7 +53,7 @@ index 378a88bbb605e22c74e5f2eea30dd9a3431c2c12..ac83b2d1b0a7973fc128cf8b54421d5c // special cases: if (minBlockY > maxBlockY) { -@@ -663,15 +664,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl +@@ -664,15 +665,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl final boolean hasSpecial = ((ca.spottedleaf.moonrise.patches.block_counting.BlockCountingChunkSection)section).moonrise$hasSpecialCollidingBlocks(); final int sectionAdjust = !hasSpecial ? 1 : 0; diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch index 5c23a7d..0948e94 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/server/level/ServerPlayer.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java -@@ -307,7 +_,7 @@ +@@ -308,7 +_,7 @@ // Paper start - Sync offhand slot in menus @Override public void sendOffHandSlotChange() { @@ -9,7 +9,7 @@ } // Paper end - Sync offhand slot in menus -@@ -442,6 +_,7 @@ +@@ -443,6 +_,7 @@ public boolean isRealPlayer; // Paper public @Nullable com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent public @Nullable org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch index f5a9f9b..97c497f 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/LivingEntity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -287,6 +_,42 @@ +@@ -288,6 +_,42 @@ public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API // CraftBukkit end @@ -43,7 +43,7 @@ protected LivingEntity(EntityType type, Level level) { super(type, level); -@@ -1520,7 +_,7 @@ +@@ -1521,7 +_,7 @@ } // Paper end - Check distance in entity interactions @@ -52,7 +52,7 @@ if (!flag) { this.indicateDamage(d, d1); } -@@ -1622,6 +_,11 @@ +@@ -1623,6 +_,11 @@ if (itemBlockingWith == null) { return false; } else { @@ -64,7 +64,7 @@ BlocksAttacks blocksAttacks = itemBlockingWith.get(DataComponents.BLOCKS_ATTACKS); if (blocksAttacks != null && !blocksAttacks.bypassedBy().map(damageSource::is).orElse(false)) { if (damageSource.getDirectEntity() instanceof AbstractArrow abstractArrow && abstractArrow.getPierceLevel() > 0) { -@@ -1648,6 +_,12 @@ +@@ -1649,6 +_,12 @@ acos = (float) Math.PI; } @@ -77,7 +77,7 @@ BlocksAttacks blocksAttacks = this.getItemBlockingWith().get(DataComponents.BLOCKS_ATTACKS); return blocksAttacks.resolveBlockedDamage(damageSource, damageAmount, acos); } -@@ -1715,7 +_,7 @@ +@@ -1716,7 +_,7 @@ } protected void blockedByItem(LivingEntity entity) { @@ -86,7 +86,7 @@ } private boolean checkTotemDeathProtection(DamageSource damageSource) { -@@ -1878,6 +_,12 @@ +@@ -1879,6 +_,12 @@ // Paper start if (this.dead) { // Paper @@ -96,10 +96,10 @@ + return; + } + // Sakura end - instant mob death animation - this.level().broadcastEntityEvent(this, (byte)3); + this.level().broadcastEntityEvent(this, EntityEvent.DEATH); this.setPose(Pose.DYING); -@@ -2075,7 +_,7 @@ +@@ -2076,7 +_,7 @@ } public void knockback(double strength, double x, double z, @Nullable Entity attacker, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause eventCause) { // Paper - knockback events @@ -108,7 +108,7 @@ if (true || !(strength <= 0.0)) { // CraftBukkit - Call event even when force is 0 // this.hasImpulse = true; // CraftBukkit - Move down Vec3 deltaMovement = this.getDeltaMovement(); -@@ -2086,10 +_,18 @@ +@@ -2087,10 +_,18 @@ } Vec3 vec3 = new Vec3(x, 0.0, z).normalize().scale(strength); @@ -128,7 +128,7 @@ deltaMovement.z / 2.0 - vec3.z ); Vec3 diff = finalVelocity.subtract(deltaMovement); -@@ -2234,8 +_,14 @@ +@@ -2235,8 +_,14 @@ } } @@ -144,7 +144,7 @@ return 0; } else { double d = this.calculateFallPower(fallDistance); -@@ -2293,9 +_,21 @@ +@@ -2294,9 +_,21 @@ protected float getDamageAfterArmorAbsorb(DamageSource damageSource, float damageAmount) { if (!damageSource.is(DamageTypeTags.BYPASSES_ARMOR)) { // this.hurtArmor(damageSource, damageAmount); // CraftBukkit - actuallyHurt(DamageSource, float, EntityDamageEvent) for damage handling @@ -166,7 +166,7 @@ } return damageAmount; -@@ -2475,6 +_,12 @@ +@@ -2476,6 +_,12 @@ armorDamage += (float) event.getDamage(DamageModifier.BLOCKING); armorDamage += (float) event.getDamage(DamageModifier.FREEZING); armorDamage += (float) event.getDamage(DamageModifier.HARD_HAT); @@ -179,7 +179,7 @@ this.hurtArmor(damageSource, armorDamage); } -@@ -3421,6 +_,11 @@ +@@ -3424,6 +_,11 @@ if (this.level() instanceof ServerLevel serverLevel) { EnchantmentHelper.runLocationChangedEffects(serverLevel, itemBySlot, this, equipmentSlot1); } @@ -191,7 +191,7 @@ } } -@@ -3621,7 +_,7 @@ +@@ -3624,7 +_,7 @@ } } // Paper end - Add EntityMoveEvent @@ -200,7 +200,7 @@ this.hurtServer(serverLevel, this.damageSources().drown(), 1.0F); } } -@@ -4205,6 +_,13 @@ +@@ -4208,6 +_,13 @@ if (!this.isUsingItem()) { return null; } else { diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/animal/IronGolem.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/animal/IronGolem.java.patch index 0a00582..6a2625f 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/animal/IronGolem.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/animal/IronGolem.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/animal/IronGolem.java +++ b/net/minecraft/world/entity/animal/IronGolem.java -@@ -230,6 +_,13 @@ +@@ -231,6 +_,13 @@ } } diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch index 9e14757..457db3f 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/player/Player.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java -@@ -180,6 +_,7 @@ +@@ -181,6 +_,7 @@ private int currentImpulseContextResetGraceTime = 0; public boolean affectsSpawning = true; // Paper - Affects Spawning API public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage @@ -8,7 +8,7 @@ // CraftBukkit start public boolean fauxSleeping; -@@ -190,6 +_,35 @@ +@@ -191,6 +_,35 @@ return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity(); } // CraftBukkit end @@ -44,7 +44,7 @@ public Player(Level level, GameProfile gameProfile) { super(EntityType.PLAYER, level); -@@ -364,7 +_,7 @@ +@@ -365,7 +_,7 @@ return new ItemCooldowns(); } @@ -53,7 +53,7 @@ if (this.canPlayerFitWithinBlocksAndEntitiesWhen(Pose.SWIMMING)) { Pose desiredPose = this.getDesiredPose(); Pose pose; -@@ -718,6 +_,10 @@ +@@ -719,6 +_,10 @@ public boolean isInvulnerableTo(ServerLevel level, DamageSource damageSource) { if (super.isInvulnerableTo(level, damageSource)) { return true; @@ -64,7 +64,7 @@ } else if (damageSource.is(DamageTypeTags.IS_DROWNING)) { return !level.getGameRules().getBoolean(GameRules.RULE_DROWNING_DAMAGE); } else if (damageSource.is(DamageTypeTags.IS_FALL)) { -@@ -755,6 +_,12 @@ +@@ -756,6 +_,12 @@ } } @@ -77,7 +77,7 @@ // return amount != 0.0F && super.hurtServer(level, damageSource, amount); // CraftBukkit start - Don't filter out 0 damage boolean damaged = super.hurtServer(level, damageSource, amount); -@@ -1030,13 +_,19 @@ +@@ -1031,13 +_,19 @@ if (playerAttackEntityEvent.callEvent() && willAttack) { // Logic moved to willAttack local variable. { // Paper end - PlayerAttackEntityEvent @@ -98,7 +98,7 @@ // this.resetAttackStrengthTicker(); // CraftBukkit - Moved to EntityLiving to reset the cooldown after the damage is dealt if (target.getType().is(EntityTypeTags.REDIRECTABLE_PROJECTILE) && target instanceof Projectile projectile) { -@@ -1054,7 +_,7 @@ +@@ -1055,7 +_,7 @@ if (f > 0.0F || f1 > 0.0F) { boolean flag = attackStrengthScale > 0.9F; boolean flag1; @@ -107,7 +107,7 @@ sendSoundEffect(this, this.getX(), this.getY(), this.getZ(), SoundEvents.PLAYER_ATTACK_KNOCKBACK, this.getSoundSource(), 1.0F, 1.0F); // Paper - send while respecting visibility flag1 = true; } else { -@@ -1070,7 +_,7 @@ +@@ -1071,7 +_,7 @@ && !this.isMobilityRestricted() && !this.isPassenger() && target instanceof LivingEntity @@ -116,7 +116,7 @@ flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits if (flag2) { damageSource = damageSource.critical(); // Paper - critical damage API -@@ -1097,7 +_,21 @@ +@@ -1098,7 +_,21 @@ if (flag4) { float f4 = this.getKnockback(target, damageSource) + (flag1 ? 1.0F : 0.0F); if (f4 > 0.0F) { @@ -139,7 +139,7 @@ livingEntity1.knockback( f4 * 0.5F, Mth.sin(this.getYRot() * (float) (Math.PI / 180.0)), -Mth.cos(this.getYRot() * (float) (Math.PI / 180.0)) , this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.ENTITY_ATTACK // Paper - knockback events -@@ -1119,7 +_,7 @@ +@@ -1120,7 +_,7 @@ // Paper end - Configurable sprint interruption on attack } @@ -148,7 +148,7 @@ float f5 = 1.0F + (float)this.getAttributeValue(Attributes.SWEEPING_DAMAGE_RATIO) * f; for (LivingEntity livingEntity2 : this.level() -@@ -1135,7 +_,7 @@ +@@ -1136,7 +_,7 @@ if (this.level() instanceof ServerLevel serverLevel && livingEntity2.hurtServer(serverLevel, damageSource.knownCause(org.bukkit.event.entity.EntityDamageEvent.DamageCause.ENTITY_SWEEP_ATTACK), f6) && !livingEntity2.lastDamageCancelled) { // Paper end - Only apply knockback if the event is not cancelled livingEntity2.knockback( @@ -157,7 +157,7 @@ , this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.SWEEP_ATTACK // Paper - knockback events ); EnchantmentHelper.doPostAttackEffects(serverLevel, livingEntity2, damageSource); -@@ -1223,7 +_,7 @@ +@@ -1224,7 +_,7 @@ if (target instanceof LivingEntity) { float f7 = f3 - ((LivingEntity)target).getHealth(); this.awardStat(Stats.DAMAGE_DEALT, Math.round(f7 * 10.0F)); @@ -166,7 +166,7 @@ int i = (int)(f7 * 0.5); ((ServerLevel)this.level()) .sendParticles(ParticleTypes.DAMAGE_INDICATOR, target.getX(), target.getY(0.5), target.getZ(), i, 0.1, 0.0, 0.1, 0.2); -@@ -1616,6 +_,11 @@ +@@ -1617,6 +_,11 @@ // Paper start - send while respecting visibility private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) { diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/AbstractThrownPotion.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/AbstractThrownPotion.java.patch index 16a0932..53cb66d 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/AbstractThrownPotion.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/AbstractThrownPotion.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/AbstractThrownPotion.java +++ b/net/minecraft/world/entity/projectile/AbstractThrownPotion.java -@@ -39,6 +_,25 @@ +@@ -40,6 +_,25 @@ super(type, x, y, z, level, item); } diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/FishingHook.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/FishingHook.java.patch index 04336d6..92a0505 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/FishingHook.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/FishingHook.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/FishingHook.java +++ b/net/minecraft/world/entity/projectile/FishingHook.java -@@ -302,6 +_,12 @@ +@@ -303,6 +_,12 @@ if (!this.level().isClientSide()) { this.setHookedEntity(result.getEntity()); } @@ -13,7 +13,7 @@ } @Override -@@ -603,7 +_,7 @@ +@@ -604,7 +_,7 @@ public void pullEntity(Entity entity) { Entity owner = this.getOwner(); diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/item/SpawnEggItem.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/item/SpawnEggItem.java.patch index 484d908..bd8a196 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/item/SpawnEggItem.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/item/SpawnEggItem.java.patch @@ -8,7 +8,7 @@ import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.AgeableMob; -@@ -98,6 +_,12 @@ +@@ -99,6 +_,12 @@ } else if (!type.isAllowedInPeaceful(stack.get(DataComponents.ENTITY_DATA).getUnsafe()) && level.getDifficulty() == Difficulty.PEACEFUL) { // Paper - check peaceful override return InteractionResult.FAIL; } else { diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/BaseSpawner.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/BaseSpawner.java.patch index 41f2d11..895e976 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/BaseSpawner.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/BaseSpawner.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/BaseSpawner.java +++ b/net/minecraft/world/level/BaseSpawner.java -@@ -55,6 +_,17 @@ +@@ -56,6 +_,17 @@ public int spawnRange = 4; private int tickDelay = 0; // Paper - Configurable mob spawner tick rate @@ -18,7 +18,7 @@ public void setEntityId(EntityType type, @Nullable Level level, RandomSource random, BlockPos pos) { this.getOrCreateNextSpawnData(level, random, pos).getEntityToSpawn().putString("id", BuiltInRegistries.ENTITY_TYPE.getKey(type).toString()); this.spawnPotentials = WeightedList.of(); // CraftBukkit - SPIGOT-3496, MC-92282 -@@ -90,7 +_,7 @@ +@@ -91,7 +_,7 @@ tickDelay = level.paperConfig().tickRates.mobSpawner; if (tickDelay == -1) { return; } // If disabled // Paper end - Configurable mob spawner tick rate @@ -27,7 +27,7 @@ if (this.spawnDelay < -tickDelay) { // Paper - Configurable mob spawner tick rate this.delay(level, pos); } -@@ -130,7 +_,7 @@ +@@ -131,7 +_,7 @@ if (!customSpawnRules.isValidPosition(blockPos, level)) { continue; } @@ -36,7 +36,7 @@ continue; } -@@ -158,12 +_,19 @@ +@@ -159,12 +_,19 @@ return; } @@ -62,7 +62,7 @@ if (size >= this.maxNearbyEntities) { this.delay(level, pos); return; -@@ -171,8 +_,11 @@ +@@ -172,8 +_,11 @@ entity.snapTo(entity.getX(), entity.getY(), entity.getZ(), random.nextFloat() * 360.0F, 0.0F); if (entity instanceof Mob mob) { diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/Level.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/Level.java.patch index b456303..8bd0c07 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/Level.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/Level.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/Level.java +++ b/net/minecraft/world/level/Level.java -@@ -114,7 +_,7 @@ +@@ -115,7 +_,7 @@ public final List blockEntityTickers = Lists.newArrayList(); public final CollectingNeighborUpdater neighborUpdater; private final List pendingBlockEntityTickers = Lists.newArrayList(); @@ -9,7 +9,7 @@ public final Thread thread; private final boolean isDebug; private int skyDarken; -@@ -164,6 +_,18 @@ +@@ -165,6 +_,18 @@ return this.paperConfig; } // Paper end - add paper world config @@ -28,7 +28,7 @@ public static @Nullable BlockPos lastPhysicsProblem; // Spigot private int tileTickPosition; -@@ -832,6 +_,7 @@ +@@ -833,6 +_,7 @@ org.bukkit.World.Environment environment, // Paper java.util.function.Function paperWorldConfigCreator, // Paper - create paper world config @@ -36,7 +36,7 @@ java.util.concurrent.Executor executor // Paper - Anti-Xray ) { // Paper start - getblock optimisations - cache world height/sections -@@ -845,6 +_,7 @@ +@@ -846,6 +_,7 @@ // Paper end - getblock optimisations - cache world height/sections this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/CactusBlock.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/CactusBlock.java.patch index 139e42d..380335f 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/CactusBlock.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/CactusBlock.java.patch @@ -29,6 +29,6 @@ + level.neighborShapeChanged(Direction.UP, blockPos, pos, state, 4, 1); + } + // Sakura end - use random chance for crop growth; fix cactus growing next to a block and not breaking - level.setBlock(pos, blockState, 260); + level.setBlock(pos, blockState, Block.UPDATE_NONE); level.neighborChanged(blockState, blockPos, this, null, false); } diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch index 27a2246..e9b2656 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/SugarCaneBlock.java.patch @@ -23,8 +23,8 @@ @@ -61,6 +_,7 @@ if (ageValue >= 15 || (modifier != 100 && random.nextFloat() < (modifier / (100.0F * 16)))) { // Spigot - SPIGOT-7159: Better modifier resolution org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(level, pos.above(), this.defaultBlockState(), 3); // CraftBukkit - level.setBlock(pos, state.setValue(AGE, 0), 260); + level.setBlock(pos, state.setValue(AGE, 0), Block.UPDATE_NONE); + // Sakura - use random chance for crop growth; conflict on change } else if (modifier == 100 || random.nextFloat() < (modifier / (100.0F * 16))) { // Spigot - SPIGOT-7159: Better modifier resolution - level.setBlock(pos, state.setValue(AGE, ageValue + 1), 260); + level.setBlock(pos, state.setValue(AGE, ageValue + 1), Block.UPDATE_NONE); } diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch index 9bfb497..8752cea 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/block/piston/PistonBaseBlock.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/block/piston/PistonBaseBlock.java +++ b/net/minecraft/world/level/block/piston/PistonBaseBlock.java -@@ -369,6 +_,14 @@ +@@ -370,6 +_,14 @@ for (int i1 = toPush.size() - 1; i1 >= 0; i1--) { // Paper start - fix a variety of piston desync dupes boolean allowDesync = io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowPistonDuplication; diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/material/LavaFluid.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/material/LavaFluid.java.patch index 3be2c04..c5400e2 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/level/material/LavaFluid.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/level/material/LavaFluid.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/level/material/LavaFluid.java +++ b/net/minecraft/world/level/material/LavaFluid.java -@@ -190,12 +_,20 @@ +@@ -192,12 +_,20 @@ @Override public int getTickDelay(LevelReader level) {