From 610014697768285c1114f871896b3f521f6c54c3 Mon Sep 17 00:00:00 2001 From: Samsuik Date: Sun, 28 Jan 2024 20:24:37 +0000 Subject: [PATCH] Copy spawnreason to respawning falling block entities --- patches/server/0019-Merge-Cannon-Entities.patch | 7 ++++--- patches/server/0021-Optimise-Fast-Movement.patch | 4 ++-- patches/server/0024-Cannon-Mechanics.patch | 4 ++-- ...wn-falling-blocks-inside-moving-pistons.patch | 4 ++-- ...033-Falling-Block-Stacking-Restrictions.patch | 6 +++--- ...040-Configure-cannon-physics-by-version.patch | 16 ++++++++-------- ...Configure-concrete-solidifying-in-water.patch | 4 ++-- 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/patches/server/0019-Merge-Cannon-Entities.patch b/patches/server/0019-Merge-Cannon-Entities.patch index e0e5898..d9c4992 100644 --- a/patches/server/0019-Merge-Cannon-Entities.patch +++ b/patches/server/0019-Merge-Cannon-Entities.patch @@ -334,10 +334,10 @@ index 393e951102c49d45a135b37ccd876283c5355710..8562e2794fc2cc29e55d34186480e820 if (this.removalReason == null) { this.removalReason = reason; diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index 0cf39ea76902e62b712057fe1bb80e3af8190fc4..3a0d82cd7a0d7ec20138effd6d84eee60ffab788 100644 +index 0cf39ea76902e62b712057fe1bb80e3af8190fc4..ac92de0478d879e30e7c099c38b0119c17a3119e 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -@@ -132,6 +132,58 @@ public class FallingBlockEntity extends Entity { +@@ -132,6 +132,59 @@ public class FallingBlockEntity extends Entity { return !this.isRemoved(); } @@ -364,6 +364,7 @@ index 0cf39ea76902e62b712057fe1bb80e3af8190fc4..3a0d82cd7a0d7ec20138effd6d84eee6 + + // Try to stack the falling block + this.entityState().apply(fallingBlock); ++ fallingBlock.spawnReason = spawnReason; + fallingBlock.time = time - 1; + fallingBlock.tick(); + @@ -396,7 +397,7 @@ index 0cf39ea76902e62b712057fe1bb80e3af8190fc4..3a0d82cd7a0d7ec20138effd6d84eee6 @Override public void tick() { // Paper start - fix sand duping -@@ -211,6 +263,7 @@ public class FallingBlockEntity extends Entity { +@@ -211,6 +264,7 @@ public class FallingBlockEntity extends Entity { return; } // CraftBukkit end diff --git a/patches/server/0021-Optimise-Fast-Movement.patch b/patches/server/0021-Optimise-Fast-Movement.patch index 8a87c79..aba2fdd 100644 --- a/patches/server/0021-Optimise-Fast-Movement.patch +++ b/patches/server/0021-Optimise-Fast-Movement.patch @@ -201,10 +201,10 @@ index 8562e2794fc2cc29e55d34186480e820bffe1237..b4dcd8569138dcf4efe3c1e38c409b09 // Paper start - optimise collisions final boolean xZero = movement.x == 0.0; diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index 3a0d82cd7a0d7ec20138effd6d84eee60ffab788..b7f9c8a6de4c07f230f99b6bfa1332166e696b49 100644 +index ac92de0478d879e30e7c099c38b0119c17a3119e..c548b1c0a9da290bc1ab52c37a792b4734e647e4 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -@@ -201,7 +201,7 @@ public class FallingBlockEntity extends Entity { +@@ -202,7 +202,7 @@ public class FallingBlockEntity extends Entity { this.addDeltaMovement(0.0D, -0.04D, 0.0D); // Sakura - reduce movement allocations } diff --git a/patches/server/0024-Cannon-Mechanics.patch b/patches/server/0024-Cannon-Mechanics.patch index e72c23c..ac344be 100644 --- a/patches/server/0024-Cannon-Mechanics.patch +++ b/patches/server/0024-Cannon-Mechanics.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Cannon Mechanics diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index b7f9c8a6de4c07f230f99b6bfa1332166e696b49..7de6f027fc8a9e7d44ae1e5fa99690dcb04a89c7 100644 +index c548b1c0a9da290bc1ab52c37a792b4734e647e4..4c1b739860f58d6f60d420840202a9b4eb45d5f3 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -67,6 +67,7 @@ public class FallingBlockEntity extends Entity { @@ -24,7 +24,7 @@ index b7f9c8a6de4c07f230f99b6bfa1332166e696b49..7de6f027fc8a9e7d44ae1e5fa99690dc } public FallingBlockEntity(Level world, double x, double y, double z, BlockState block) { -@@ -183,6 +185,12 @@ public class FallingBlockEntity extends Entity { +@@ -184,6 +186,12 @@ public class FallingBlockEntity extends Entity { return itemEntity; } // Sakura end diff --git a/patches/server/0028-Despawn-falling-blocks-inside-moving-pistons.patch b/patches/server/0028-Despawn-falling-blocks-inside-moving-pistons.patch index f631393..427b98b 100644 --- a/patches/server/0028-Despawn-falling-blocks-inside-moving-pistons.patch +++ b/patches/server/0028-Despawn-falling-blocks-inside-moving-pistons.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Despawn falling blocks inside moving pistons diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index 69f5f03a8e43f1e7370981009fe2376294b7253a..78fe35df4ef92f56d5ea2e80131fb7f4e71c9bea 100644 +index 4c1b739860f58d6f60d420840202a9b4eb45d5f3..31cca38c40c5ca65f574568a316a72b163ff4b3a 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -@@ -242,7 +242,7 @@ public class FallingBlockEntity extends Entity { +@@ -243,7 +243,7 @@ public class FallingBlockEntity extends Entity { } } diff --git a/patches/server/0033-Falling-Block-Stacking-Restrictions.patch b/patches/server/0033-Falling-Block-Stacking-Restrictions.patch index 1502ae7..193673e 100644 --- a/patches/server/0033-Falling-Block-Stacking-Restrictions.patch +++ b/patches/server/0033-Falling-Block-Stacking-Restrictions.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Falling Block Stacking Restrictions diff --git a/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java -index 376322d8e47e24a76c7162d6379c7f71debd7505..872b874649ff5383af73f6b07dd59fdabea3ffb2 100644 +index 9bbd239ee24fb0d31d216287af480a70b93ca192..348ab32d0b0fb8c7ecda36028c0be73b670cbbce 100644 --- a/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java +++ b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java @@ -69,7 +69,7 @@ public class WorldConfiguration extends ConfigurationPart { @@ -18,10 +18,10 @@ index 376322d8e47e24a76c7162d6379c7f71debd7505..872b874649ff5383af73f6b07dd59fda } } diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index d7a3d869417983ea3758c2fab2de78c098826b19..6274c005f4f53f3cec0c94b7d40cdb7070b190e0 100644 +index 31cca38c40c5ca65f574568a316a72b163ff4b3a..cd97bc46489544e43e721488254d66ff0e5064d5 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -@@ -260,7 +260,7 @@ public class FallingBlockEntity extends Entity { +@@ -261,7 +261,7 @@ public class FallingBlockEntity extends Entity { boolean flag3 = FallingBlock.isFree(this.level().getBlockState(blockposition.below())) && (!flag || !flag1); boolean flag4 = this.blockState.canSurvive(this.level(), blockposition) && !flag3; diff --git a/patches/server/0040-Configure-cannon-physics-by-version.patch b/patches/server/0040-Configure-cannon-physics-by-version.patch index a13c0cb..ccc3f9c 100644 --- a/patches/server/0040-Configure-cannon-physics-by-version.patch +++ b/patches/server/0040-Configure-cannon-physics-by-version.patch @@ -36,7 +36,7 @@ index 19086bbfdf3a015eafec5ca868c8d2451f554ef0..a40dcbde87860fd6d3b60d0b9e2d5e63 if (xSmaller && z != 0.0) { z = performAABBCollisionsZ(axisalignedbb, z, aabbs); diff --git a/src/main/java/me/samsuik/sakura/explosion/SakuraExplosion.java b/src/main/java/me/samsuik/sakura/explosion/SakuraExplosion.java -index b87748ae90863abe8f85dcbdc5a202cb3c9e2037..a291516ec7bdb9d8b840f41ca52e6bbaf8e2e08a 100644 +index b44d41314f60eabb72e72621fd6aa6625034ee14..2117c42ddc2955cfcd0aca0df795d10ae0d1117a 100644 --- a/src/main/java/me/samsuik/sakura/explosion/SakuraExplosion.java +++ b/src/main/java/me/samsuik/sakura/explosion/SakuraExplosion.java @@ -163,7 +163,7 @@ public class SakuraExplosion extends Explosion { @@ -87,7 +87,7 @@ index b87748ae90863abe8f85dcbdc5a202cb3c9e2037..a291516ec7bdb9d8b840f41ca52e6bba x /= distance; y /= distance; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2beb43acfd1e4cc26e50ae11fd1eec6080d7c1fd..599706984734b8979b432b1bbc15f8ac13d2b334 100644 +index d94c0e00ba8737f3da4c934d8085654d9acba825..fa92eb021cfc44795393d4fcaac44435d2241702 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -378,7 +378,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @@ -226,7 +226,7 @@ index 2beb43acfd1e4cc26e50ae11fd1eec6080d7c1fd..599706984734b8979b432b1bbc15f8ac if (this.level().hasChunksAt(blockposition, blockposition1)) { BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos(); diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index 6274c005f4f53f3cec0c94b7d40cdb7070b190e0..586c957d33a4ffbdc584267e1f10c8e5b37d6b0a 100644 +index cd97bc46489544e43e721488254d66ff0e5064d5..14c91fe6e86b1c052d60b4bd7c11e33d0aac8d6a 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java @@ -89,6 +89,8 @@ public class FallingBlockEntity extends Entity { @@ -251,7 +251,7 @@ index 6274c005f4f53f3cec0c94b7d40cdb7070b190e0..586c957d33a4ffbdc584267e1f10c8e5 world.addFreshEntity(entityfallingblock, spawnReason); // CraftBukkit return entityfallingblock; } -@@ -188,7 +194,44 @@ public class FallingBlockEntity extends Entity { +@@ -189,7 +195,44 @@ public class FallingBlockEntity extends Entity { // Sakura start @Override public final double getEyeY() { @@ -297,7 +297,7 @@ index 6274c005f4f53f3cec0c94b7d40cdb7070b190e0..586c957d33a4ffbdc584267e1f10c8e5 } // Sakura end -@@ -204,9 +247,16 @@ public class FallingBlockEntity extends Entity { +@@ -205,9 +248,16 @@ public class FallingBlockEntity extends Entity { } else { Block block = this.blockState.getBlock(); @@ -315,7 +315,7 @@ index 6274c005f4f53f3cec0c94b7d40cdb7070b190e0..586c957d33a4ffbdc584267e1f10c8e5 } this.moveBasic(MoverType.SELF, this.getDeltaMovement()); // Sakura -@@ -227,8 +277,16 @@ public class FallingBlockEntity extends Entity { +@@ -228,8 +278,16 @@ public class FallingBlockEntity extends Entity { return; } // Paper end @@ -333,7 +333,7 @@ index 6274c005f4f53f3cec0c94b7d40cdb7070b190e0..586c957d33a4ffbdc584267e1f10c8e5 boolean flag = this.blockState.getBlock() instanceof ConcretePowderBlock; boolean flag1 = flag && this.level().getFluidState(blockposition).is(FluidTags.WATER); double d0 = this.getDeltaMovement().lengthSqr(); -@@ -253,8 +311,11 @@ public class FallingBlockEntity extends Entity { +@@ -254,8 +312,11 @@ public class FallingBlockEntity extends Entity { } else { BlockState iblockdata = this.level().getBlockState(blockposition); @@ -347,7 +347,7 @@ index 6274c005f4f53f3cec0c94b7d40cdb7070b190e0..586c957d33a4ffbdc584267e1f10c8e5 if (!this.cancelDrop) { boolean flag2 = iblockdata.canBeReplaced((BlockPlaceContext) (new DirectionalPlaceContext(this.level(), blockposition, Direction.DOWN, ItemStack.EMPTY, Direction.UP))); boolean flag3 = FallingBlock.isFree(this.level().getBlockState(blockposition.below())) && (!flag || !flag1); -@@ -321,7 +382,12 @@ public class FallingBlockEntity extends Entity { +@@ -322,7 +383,12 @@ public class FallingBlockEntity extends Entity { } } diff --git a/patches/server/0042-Configure-concrete-solidifying-in-water.patch b/patches/server/0042-Configure-concrete-solidifying-in-water.patch index c6be7ee..4f13e21 100644 --- a/patches/server/0042-Configure-concrete-solidifying-in-water.patch +++ b/patches/server/0042-Configure-concrete-solidifying-in-water.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configure concrete solidifying in water diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -index 99887ed1044cff244074a4584729df50239e9e9a..bdea4539bd3c0448c16ccb19bb4a7a932fcef9e1 100644 +index 14c91fe6e86b1c052d60b4bd7c11e33d0aac8d6a..d218dda9b7d88ea10cc4caf527c5fa3d3cacd3ad 100644 --- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java +++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java -@@ -287,7 +287,7 @@ public class FallingBlockEntity extends Entity { +@@ -288,7 +288,7 @@ public class FallingBlockEntity extends Entity { BlockPos blockposition = this.physics.before(1_17_0) ? this.patchedBlockPosition() : this.blockPosition(); // Sakura end