diff --git a/patches/server/0004-Sakura-Configuration-Files.patch b/patches/server/0004-Sakura-Configuration-Files.patch index 7e7c275..7091b4b 100644 --- a/patches/server/0004-Sakura-Configuration-Files.patch +++ b/patches/server/0004-Sakura-Configuration-Files.patch @@ -608,10 +608,10 @@ index 0000000000000000000000000000000000000000..5fc23a0b579d7cbe03baf5324bef887a +} diff --git a/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java new file mode 100644 -index 0000000000000000000000000000000000000000..4c8e90dbfa8c3d6d211dc8890f7dfcc52667a180 +index 0000000000000000000000000000000000000000..270ff55bc37e581be66e843cd8fe2a91b0d66d09 --- /dev/null +++ b/src/main/java/me/samsuik/sakura/configuration/WorldConfiguration.java -@@ -0,0 +1,152 @@ +@@ -0,0 +1,157 @@ +package me.samsuik.sakura.configuration; + +import com.mojang.logging.LogUtils; @@ -660,6 +660,11 @@ index 0000000000000000000000000000000000000000..4c8e90dbfa8c3d6d211dc8890f7dfcc5 + public MergeLevel mergeLevel = MergeLevel.STRICT; + public boolean tntAndSandAffectedByBubbleColumns = true; + ++ @NestedSetting({"treat-collidable-blocks-as-full", "while-moving"}) ++ public boolean treatAllBlocksAsFullWhenMoving = false; ++ @NestedSetting({"treat-collidable-blocks-as-full", "moving-faster-than"}) ++ public double treatAllBlocksAsFullWhenMovingFasterThan = 64.0; ++ + public Tnt tnt = new Tnt(); + public class Tnt extends ConfigurationPart { + public boolean loadsChunks; diff --git a/patches/server/0010-Load-Chunks-on-Movement.patch b/patches/server/0010-Load-Chunks-on-Movement.patch index 552f2e4..1c327ff 100644 --- a/patches/server/0010-Load-Chunks-on-Movement.patch +++ b/patches/server/0010-Load-Chunks-on-Movement.patch @@ -50,32 +50,44 @@ index 658e63ebde81dc14c8ab5850fb246dc0aab25dea..f1ff1a67fee37ee7b241ceaa164fa4ee public static TicketType create(String name, Comparator argumentComparator) { return new TicketType<>(name, argumentComparator, 0L); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a52530dbcd8a3e48a26f13fb246e8183ee560b07..1297012df74a2c955c4f0c87697f802a70ad16f3 100644 +index a52530dbcd8a3e48a26f13fb246e8183ee560b07..f74e590a2f492fd54d3e718bed8b0b0cf5f12cea 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -398,6 +398,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only - public boolean lastDamageCancelled; // SPIGOT-5339, SPIGOT-6252, SPIGOT-6777: Keep track if the event was canceled - public boolean persistentInvisibility = false; -+ public boolean loadChunks = false; // Sakura - load chunks - public BlockPos lastLavaContact; - // Spigot start - public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); -@@ -1490,7 +1491,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -533,6 +533,19 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + // Paper end - make end portalling safe + public boolean isPrimedTNT; // Sakura + public boolean isFallingBlock; // Sakura ++ // Sakura start ++ protected boolean loadChunks = false; ++ ++ private int getCollisionFlags() { ++ int flags = 0; ++ ++ if (this.loadChunks) { ++ flags |= io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_LOAD_CHUNKS | io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_ADD_TICKET; ++ } ++ ++ return flags; ++ } ++ // Sakura end + + public boolean isLegacyTrackingEntity = false; + +@@ -1490,7 +1503,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { io.papermc.paper.util.CollisionUtil.getCollisions( world, this, collisionBox, potentialCollisionsVoxel, potentialCollisionsBB, - (0), -+ (loadChunks ? io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_LOAD_CHUNKS | io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_ADD_TICKET : 0), // Sakura ++ this.getCollisionFlags(), // Sakura null, null ); -@@ -4812,7 +4813,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4812,7 +4825,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @Override public boolean isAlwaysTicking() { - return false; -+ return loadChunks; // Sakura - always tick in chunks ++ return this.loadChunks; // Sakura - always tick in chunks } public boolean mayInteract(Level world, BlockPos pos) { diff --git a/patches/server/0013-Slice-Packet-obfuscation-and-reduction.patch b/patches/server/0013-Slice-Packet-obfuscation-and-reduction.patch index f56d051..8239904 100644 --- a/patches/server/0013-Slice-Packet-obfuscation-and-reduction.patch +++ b/patches/server/0013-Slice-Packet-obfuscation-and-reduction.patch @@ -203,10 +203,10 @@ index 83c4639c2bdca4dc4281d9f5eca104af3063bfa5..f7d8aaededd39ce52a9d0105f66fd759 if (this.entity instanceof LivingEntity) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1297012df74a2c955c4f0c87697f802a70ad16f3..a6c42038cba6b272a472a2b6c78cf741ff8228fd 100644 +index f74e590a2f492fd54d3e718bed8b0b0cf5f12cea..f00a5a68e12f1881857eed7ffaf22a656a9ef2af 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -3333,7 +3333,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -3345,7 +3345,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.entityData.markDirty(Entity.DATA_AIR_SUPPLY_ID); return; } diff --git a/patches/server/0018-Store-Entity-Data-State.patch b/patches/server/0018-Store-Entity-Data-State.patch index 5cb223c..6c03a87 100644 --- a/patches/server/0018-Store-Entity-Data-State.patch +++ b/patches/server/0018-Store-Entity-Data-State.patch @@ -52,13 +52,13 @@ index 0000000000000000000000000000000000000000..c9f2c5ae57878283e8c8bc3847fe63b9 + +} diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a6c42038cba6b272a472a2b6c78cf741ff8228fd..9118ebf8c0f2fc4cb8fb438426ef49cbdf9acc52 100644 +index f00a5a68e12f1881857eed7ffaf22a656a9ef2af..cbb2853f56c3339826fcaaff20ba93f62e56a761 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -534,6 +534,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { - // Paper end - make end portalling safe - public boolean isPrimedTNT; // Sakura - public boolean isFallingBlock; // Sakura +@@ -546,6 +546,34 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + return flags; + } + // Sakura end + // Sakura start - entity state (from start of tick) + private @Nullable me.samsuik.sakura.entity.EntityState entityState = null; + diff --git a/patches/server/0019-Merge-Cannon-Entities.patch b/patches/server/0019-Merge-Cannon-Entities.patch index b62cffc..cc33447 100644 --- a/patches/server/0019-Merge-Cannon-Entities.patch +++ b/patches/server/0019-Merge-Cannon-Entities.patch @@ -189,10 +189,10 @@ index efba8d153b5838ff1dbc68d389b4d1529c951008..fd25999781d99526b1bc1677aaa3ff74 this.guardEntityTick(this::tickNonPassenger, entity); gameprofilerfiller.pop(); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9118ebf8c0f2fc4cb8fb438426ef49cbdf9acc52..639712fe3e81703791b87622ae598c11b274802f 100644 +index cbb2853f56c3339826fcaaff20ba93f62e56a761..9564477334755756b49fc7bf9f7344912758d47e 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -562,6 +562,105 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -574,6 +574,105 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return BlockPos.asLong(v.getBlockX(), v.getBlockY(), v.getBlockZ()); } // Sakura end @@ -298,7 +298,7 @@ index 9118ebf8c0f2fc4cb8fb438426ef49cbdf9acc52..639712fe3e81703791b87622ae598c11 public boolean isLegacyTrackingEntity = false; -@@ -640,6 +739,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -652,6 +751,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.getEntityData().registrationLocked = true; // Spigot this.setPos(0.0D, 0.0D, 0.0D); this.eyeHeight = this.getEyeHeight(net.minecraft.world.entity.Pose.STANDING, this.dimensions); @@ -306,7 +306,7 @@ index 9118ebf8c0f2fc4cb8fb438426ef49cbdf9acc52..639712fe3e81703791b87622ae598c11 } public boolean isColliding(BlockPos pos, BlockState state) { -@@ -2487,6 +2587,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2499,6 +2599,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { nbt.putBoolean("Paper.FreezeLock", true); } // Paper end @@ -318,7 +318,7 @@ index 9118ebf8c0f2fc4cb8fb438426ef49cbdf9acc52..639712fe3e81703791b87622ae598c11 return nbt; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT"); -@@ -2634,6 +2739,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2646,6 +2751,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { freezeLocked = nbt.getBoolean("Paper.FreezeLock"); } // Paper end @@ -330,7 +330,7 @@ index 9118ebf8c0f2fc4cb8fb438426ef49cbdf9acc52..639712fe3e81703791b87622ae598c11 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT"); -@@ -4796,6 +4906,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4808,6 +4918,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return; } // Paper end - rewrite chunk system diff --git a/patches/server/0021-Optimise-Fast-Movement.patch b/patches/server/0021-Optimise-Fast-Movement.patch index fc8894a..fb28bc3 100644 --- a/patches/server/0021-Optimise-Fast-Movement.patch +++ b/patches/server/0021-Optimise-Fast-Movement.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Optimise Fast Movement diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 639712fe3e81703791b87622ae598c11b274802f..97b11192592f67c976dc5567cfeaad55e7780c18 100644 +index 9564477334755756b49fc7bf9f7344912758d47e..ffa4bb17c002a953df4142e353ba9a05b362e3e6 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1198,6 +1198,95 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1210,6 +1210,95 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } // Paper end - detailed watchdog information @@ -104,7 +104,7 @@ index 639712fe3e81703791b87622ae598c11b274802f..97b11192592f67c976dc5567cfeaad55 public void move(MoverType movementType, Vec3 movement) { // Paper start - detailed watchdog information io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main"); -@@ -1575,6 +1664,99 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1587,6 +1676,99 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return offsetFactor; } @@ -170,7 +170,7 @@ index 639712fe3e81703791b87622ae598c11b274802f..97b11192592f67c976dc5567cfeaad55 + // Copied from the collide method below + io.papermc.paper.util.CollisionUtil.getCollisions( + level, this, collisionBox, voxelList, bbList, -+ (loadChunks ? io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_LOAD_CHUNKS | io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_ADD_TICKET : 0), // Sakura ++ this.getCollisionFlags(), // Sakura + null, null + ); + diff --git a/patches/server/0023-isPushedByFluid-API.patch b/patches/server/0023-isPushedByFluid-API.patch index 3d808a7..4d506f5 100644 --- a/patches/server/0023-isPushedByFluid-API.patch +++ b/patches/server/0023-isPushedByFluid-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] isPushedByFluid API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 97b11192592f67c976dc5567cfeaad55e7780c18..9feef1fd078cd0ca59f4cc6a7346d8eaa24a15e1 100644 +index ffa4bb17c002a953df4142e353ba9a05b362e3e6..a7984107161d74aed3f064df1e2576c39a88c506 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -661,6 +661,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -673,6 +673,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { discard(); } // Sakura end @@ -16,7 +16,7 @@ index 97b11192592f67c976dc5567cfeaad55e7780c18..9feef1fd078cd0ca59f4cc6a7346d8ea public boolean isLegacyTrackingEntity = false; -@@ -4166,7 +4167,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -4178,7 +4179,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } public boolean isPushedByFluid() { diff --git a/patches/server/0026-Optimise-TNT-fluid-state-and-pushing.patch b/patches/server/0026-Optimise-TNT-fluid-state-and-pushing.patch index 9aa7812..2a88a0d 100644 --- a/patches/server/0026-Optimise-TNT-fluid-state-and-pushing.patch +++ b/patches/server/0026-Optimise-TNT-fluid-state-and-pushing.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Optimise TNT fluid state and pushing diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9feef1fd078cd0ca59f4cc6a7346d8eaa24a15e1..eab1b1043f27c3f996e820b3b50e2689c84e8822 100644 +index a7984107161d74aed3f064df1e2576c39a88c506..d4e4b74e153e5445e2319351c5fb8c17d115b26f 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2168,7 +2168,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -2180,7 +2180,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return this.isInWater() || flag; } diff --git a/patches/server/0040-Configure-cannon-physics-by-version.patch b/patches/server/0040-Configure-cannon-physics-by-version.patch index 2da4b61..07405d7 100644 --- a/patches/server/0040-Configure-cannon-physics-by-version.patch +++ b/patches/server/0040-Configure-cannon-physics-by-version.patch @@ -78,7 +78,7 @@ index a605a56ec780f871362fc9abc9bb315572ef254b..19713d18421f5bdd20fa362b4cc4eeb6 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 eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb661fe037 100644 +index d4e4b74e153e5445e2319351c5fb8c17d115b26f..2530eae662d8f423e62f4b237d23bbd77fedc3d3 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -377,7 +377,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -90,7 +90,7 @@ index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb public boolean isInPowderSnow; public boolean wasInPowderSnow; public boolean wasOnFire; -@@ -662,6 +662,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -674,6 +674,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } // Sakura end public boolean pushedByFluid = true; // Sakura @@ -104,7 +104,7 @@ index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb public boolean isLegacyTrackingEntity = false; -@@ -1144,7 +1151,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1156,7 +1163,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { } protected void checkSupportingBlock(boolean onGround, @Nullable Vec3 movement) { @@ -113,7 +113,7 @@ index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb AABB axisalignedbb = this.getBoundingBox(); AABB axisalignedbb1 = new AABB(axisalignedbb.minX, axisalignedbb.minY - 1.0E-6D, axisalignedbb.minZ, axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ); Optional optional = this.level.findSupportingBlock(this, axisalignedbb1); -@@ -1206,7 +1213,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1218,7 +1225,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { if (this.noPhysics) { this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); } else { @@ -122,7 +122,7 @@ index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb movement = this.limitPistonMovement(movement); if (movement.equals(Vec3.ZERO)) { return; -@@ -1224,10 +1231,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1236,10 +1243,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { Vec3 vec3d1 = this.collideScan(movement); double d0 = vec3d1.lengthSqr(); @@ -135,7 +135,7 @@ index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb BlockHitResult movingobjectpositionblock = this.level().clip(new ClipContext(this.position(), this.position().add(vec3d1), ClipContext.Block.FALLDAMAGE_RESETTING, ClipContext.Fluid.WATER, this)); if (movingobjectpositionblock.getType() != HitResult.Type.MISS) { -@@ -1263,6 +1270,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1275,6 +1282,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { if (this.horizontalCollision) { Vec3 vec3d2 = this.getDeltaMovement(); @@ -148,7 +148,7 @@ index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb this.setDeltaMovement(flag ? 0.0D : vec3d2.x, vec3d2.y, flag1 ? 0.0D : vec3d2.z); } -@@ -1303,7 +1316,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1315,7 +1328,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); } else { this.wasOnFire = this.isOnFire(); @@ -157,7 +157,7 @@ index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb this.activatedTick = Math.max(this.activatedTick, MinecraftServer.currentTick + 20); // Paper this.activatedImmunityTick = Math.max(this.activatedImmunityTick, MinecraftServer.currentTick + 20); // Paper movement = this.limitPistonMovement(movement); -@@ -1330,8 +1343,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1342,8 +1355,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { Vec3 vec3d1 = this.collide(movement); double d0 = vec3d1.lengthSqr(); @@ -168,7 +168,7 @@ index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb BlockHitResult movingobjectpositionblock = this.level().clip(new ClipContext(this.position(), this.position().add(vec3d1), ClipContext.Block.FALLDAMAGE_RESETTING, ClipContext.Fluid.WATER, this)); if (movingobjectpositionblock.getType() != HitResult.Type.MISS) { -@@ -1367,6 +1380,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1379,6 +1392,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { if (this.horizontalCollision) { Vec3 vec3d2 = this.getDeltaMovement(); @@ -181,7 +181,7 @@ index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb this.setDeltaMovement(flag ? 0.0D : vec3d2.x, vec3d2.y, flag1 ? 0.0D : vec3d2.z); } -@@ -1690,7 +1709,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1702,7 +1721,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { double y = movement.y; double z = movement.z; @@ -193,7 +193,7 @@ index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb if (y != 0.0) { y = scanY(currBoundingBox, y, voxelList, bbList); -@@ -1814,7 +1836,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1826,7 +1848,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { return movement; } @@ -202,7 +202,7 @@ index eab1b1043f27c3f996e820b3b50e2689c84e8822..cd67b7fb3aa460cbfd794c90f1a3e3fb if (stepHeight > 0.0 && (onGround || (limitedMoveVector.y != movement.y && movement.y < 0.0)) -@@ -1930,8 +1952,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { +@@ -1942,8 +1964,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { protected void checkInsideBlocks() { AABB axisalignedbb = this.getBoundingBox(); @@ -459,7 +459,7 @@ index 16560ef566d3b37e2916be2bf96809556c8893ca..2fbe1da39e9176beededfb5a79e41f1f // Paper end } diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index ae727a3652b27706724be1936885da6eb36c50a5..1e67696d718c95e77023c4625948edd48c213363 100644 +index 3f4263d4e118e58e07c992c3128030d255672320..c94e2bf305437b88f82dbb8ab105cfbf5dec01f8 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -69,6 +69,7 @@ public class Explosion { diff --git a/patches/server/0046-Treat-all-collidable-blocks-as-full-while-moving-fas.patch b/patches/server/0046-Treat-all-collidable-blocks-as-full-while-moving-fas.patch new file mode 100644 index 0000000..c8e97fb --- /dev/null +++ b/patches/server/0046-Treat-all-collidable-blocks-as-full-while-moving-fas.patch @@ -0,0 +1,79 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Samsuik <40902469+Samsuik@users.noreply.github.com> +Date: Sun, 26 Nov 2023 17:57:50 +0000 +Subject: [PATCH] Treat all collidable blocks as full while moving fast + + +diff --git a/src/main/java/io/papermc/paper/util/CollisionUtil.java b/src/main/java/io/papermc/paper/util/CollisionUtil.java +index 7ced5ae768cbea9ee0a7bab2365fbaef1a37d9bd..310ad76abcb263fbb067270f522007457c62c81b 100644 +--- a/src/main/java/io/papermc/paper/util/CollisionUtil.java ++++ b/src/main/java/io/papermc/paper/util/CollisionUtil.java +@@ -1607,6 +1607,7 @@ public final class CollisionUtil { + public static final int COLLISION_FLAG_CHECK_BORDER = 1 << 2; + public static final int COLLISION_FLAG_CHECK_ONLY = 1 << 3; + public static final int COLLISION_FLAG_ADD_TICKET = 1 << 4; // Sakura ++ public static final int COLLISION_FLAG_FULL_BLOCKS = 1 << 5; // Sakura + + public static boolean getCollisionsForBlocksOrWorldBorder(final Level world, final Entity entity, final AABB aabb, + final List intoVoxel, final List intoAABB, +@@ -1657,6 +1658,7 @@ public final class CollisionUtil { + + final boolean loadChunks = (collisionFlags & COLLISION_FLAG_LOAD_CHUNKS) != 0; + final boolean addTicket = (collisionFlags & COLLISION_FLAG_ADD_TICKET) != 0; // Sakura ++ final boolean fullBlocks = (collisionFlags & COLLISION_FLAG_FULL_BLOCKS) != 0; // Sakura + final ServerChunkCache chunkSource = (ServerChunkCache)world.getChunkSource(); + + for (int currChunkZ = minChunkZ; currChunkZ <= maxChunkZ; ++currChunkZ) { +@@ -1697,7 +1699,7 @@ public final class CollisionUtil { + continue; + } + +- final boolean hasSpecial = section.getSpecialCollidingBlocks() != 0; ++ final boolean hasSpecial = !fullBlocks && section.getSpecialCollidingBlocks() != 0; // Sakura + final int sectionAdjust = !hasSpecial ? 1 : 0; + + final PalettedContainer blocks = section.states; +@@ -1731,12 +1733,20 @@ public final class CollisionUtil { + } + + if (edgeCount == 0 || ((edgeCount != 1 || blockData.hasLargeCollisionShape()) && (edgeCount != 2 || blockData.getBlock() == Blocks.MOVING_PISTON))) { +- VoxelShape blockCollision = blockData.getConstantCollisionShape(); ++ // Sakura start - if flag is set treat all block as full ++ VoxelShape blockCollision; + +- if (blockCollision == null) { +- mutablePos.set(blockX, blockY, blockZ); +- blockCollision = blockData.getCollisionShape(world, mutablePos, collisionShape); ++ if (fullBlocks) { ++ blockCollision = Shapes.block(); ++ } else { ++ blockCollision = blockData.getConstantCollisionShape(); ++ ++ if (blockCollision == null) { ++ mutablePos.set(blockX, blockY, blockZ); ++ blockCollision = blockData.getCollisionShape(world, mutablePos, collisionShape); ++ } + } ++ // Sakura end + + AABB singleAABB = blockCollision.getSingleAABBRepresentation(); + if (singleAABB != null) { +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 2530eae662d8f423e62f4b237d23bbd77fedc3d3..eb8c83e336c4672376796fd6cba6436035202d04 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -543,6 +543,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { + flags |= io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_LOAD_CHUNKS | io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_ADD_TICKET; + } + ++ if (this.level().sakuraConfig().cannons.treatAllBlocksAsFullWhenMoving && this.isPrimedTNT | this.isFallingBlock) { ++ this.syncDeltaMovement(); ++ double horizontalMovementSqr = this.movementX*this.movementX + this.movementZ*this.movementZ; ++ if (horizontalMovementSqr > Math.pow(this.level().sakuraConfig().cannons.treatAllBlocksAsFullWhenMovingFasterThan, 2.0)) { ++ flags |= io.papermc.paper.util.CollisionUtil.COLLISION_FLAG_FULL_BLOCKS; ++ } ++ } ++ + return flags; + } + // Sakura end