diff --git a/gradle.properties b/gradle.properties index 4511dd0..b9e194a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group=me.samsuik.sakura version=1.21.4-R0.1-SNAPSHOT mcVersion=1.21.4 -paperRef=46f4fdaae3661941ac86f2157e625d907fdd8e81 +paperRef=8eb8e44ac32a99f53da7af50e800ac8831030580 org.gradle.jvmargs=-Xmx2G org.gradle.vfs.watch=false 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 799dc4e..77f6ebd 100644 --- a/sakura-server/minecraft-patches/features/0002-Client-Visibility-Settings.patch +++ b/sakura-server/minecraft-patches/features/0002-Client-Visibility-Settings.patch @@ -78,7 +78,7 @@ index 8f9f759885a9cda57ae7d665ec309a57e12969fd..e096463443639e9eef5311d7154f6d2a if (flag && !player.getBukkitEntity().canSee(this.entity.getBukkitEntity())) { // Paper - only consider hits flag = false; diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index b49a0c3eb4236c71e390f42278412dce59e98cbd..0604b5075122494ec82b4e1b458645958b93c806 100644 +index ca41cfe5f36b5820238df4ec4d2c749668b750f1..f2c0cd46a64fbc3fc7e6cb77acac353bb84d4073 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java @@ -569,6 +569,21 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -111,7 +111,7 @@ index b49a0c3eb4236c71e390f42278412dce59e98cbd..0604b5075122494ec82b4e1b45864595 } // Paper start -@@ -1854,7 +1870,18 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1856,7 +1872,18 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe for (ServerPlayer serverPlayer : this.players) { if (serverPlayer.distanceToSqr(vec3) < 4096.0) { Optional optional = Optional.ofNullable(serverExplosion.getHitPlayers().get(serverPlayer)); @@ -195,7 +195,7 @@ index e71c1a564e5d4ac43460f89879ff709ee685706f..7d2fe5df38db1d492ae65aa729592002 } } diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 882dbb1276c548316938bbc50f5f7e01f8547ff8..b2079b8c8ba713f48c89ccd7c871af1ff4beb21e 100644 +index 660f9d44739909150635beaa2082e85dfde915c4..648d9219cd496b1793198d5914665c346449b22e 100644 --- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -3192,6 +3192,7 @@ public class ServerGamePacketListenerImpl @@ -207,10 +207,10 @@ index 882dbb1276c548316938bbc50f5f7e01f8547ff8..b2079b8c8ba713f48c89ccd7c871af1f if (this.player.containerMenu != oldContainer) { return; diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index a652ed38dd54c43547e272204154e791fb666f48..d0107d42212ddff92b5637205417e98ac76dfd69 100644 +index 362c9516850fa20719a234309d2416fde5e5b324..789a64f13185b8d761e290e931ed31f8c04c6255 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -522,6 +522,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -523,6 +523,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } // Paper end - optimise entity tracker public boolean pushedByFluid = true; // Sakura - entity pushed by fluid api diff --git a/sakura-server/minecraft-patches/features/0003-Load-Chunks-on-Movement.patch b/sakura-server/minecraft-patches/features/0003-Load-Chunks-on-Movement.patch index 89d2c44..4cb3b27 100644 --- a/sakura-server/minecraft-patches/features/0003-Load-Chunks-on-Movement.patch +++ b/sakura-server/minecraft-patches/features/0003-Load-Chunks-on-Movement.patch @@ -51,10 +51,10 @@ index 8f12a4df5d63ecd11e6e615d910b6e3f6dde5f3c..56beffa0c5cdb0d6a4836a0ee496bd63 public static TicketType create(String name, Comparator comparator) { return new TicketType<>(name, comparator, 0L); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index d0107d42212ddff92b5637205417e98ac76dfd69..2208f8c2176451eb65eeba05d47703f58e5d3e29 100644 +index 789a64f13185b8d761e290e931ed31f8c04c6255..9bdf3f54198c345e2091835af56b730d6aa4a7ec 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -526,6 +526,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -527,6 +527,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess public boolean isPrimedTNT; public boolean isFallingBlock; // Sakura end - client visibility settings @@ -75,7 +75,7 @@ index d0107d42212ddff92b5637205417e98ac76dfd69..2208f8c2176451eb65eeba05d47703f5 public Entity(EntityType entityType, Level level) { this.type = entityType; -@@ -1465,7 +1479,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1466,7 +1480,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.getCollisionsForBlocksOrWorldBorder( this.level, (Entity)(Object)this, initialCollisionBox, potentialCollisionsVoxel, potentialCollisionsBB, @@ -84,7 +84,7 @@ index d0107d42212ddff92b5637205417e98ac76dfd69..2208f8c2176451eb65eeba05d47703f5 ); potentialCollisionsBB.addAll(entityAABBs); final Vec3 collided = ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.performCollisions(movement, currentBox, potentialCollisionsVoxel, potentialCollisionsBB); -@@ -4957,13 +4971,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4958,13 +4972,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @Override public boolean shouldBeSaved() { return (this.removalReason == null || this.removalReason.shouldSave()) 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 68028df..923fcd2 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,10 +153,10 @@ index 0fb253aa55a24b56b17f524b3261c5b75c7d7e59..8abe899d19434ad4c7cc6c1596bab16d if (this.entity instanceof LivingEntity) { diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 2208f8c2176451eb65eeba05d47703f58e5d3e29..5e48d84c5ab335975f6533472aec1e1789375bbf 100644 +index 9bdf3f54198c345e2091835af56b730d6aa4a7ec..63813792c1ae5a27cb42a0acb2c64d1a1e712a05 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -3491,7 +3491,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -3492,7 +3492,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.entityData.markDirty(Entity.DATA_AIR_SUPPLY_ID); return; } @@ -196,7 +196,7 @@ index 3c74cb8d4b71fcfa600742c21d6ad8e3942a2ab7..b6467f9ff64a76104076a01bfd56852c public int getFuse() { diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java -index c1630a2ea3c89f9acc9f3f20faacae769e7449d1..6f3c0f5c68af30619fd46204f930c0da2f789670 100644 +index 4237b743c31f6c6ed0f4c6c69dc4f3007371d77a..102209683ab501b098e4a3f3e30e4aad67a051bd 100644 --- a/net/minecraft/world/entity/player/Player.java +++ b/net/minecraft/world/entity/player/Player.java @@ -673,7 +673,7 @@ public abstract class Player extends LivingEntity { diff --git a/sakura-server/minecraft-patches/features/0006-Store-Entity-Data-State.patch b/sakura-server/minecraft-patches/features/0006-Store-Entity-Data-State.patch index d36069b..c254a9a 100644 --- a/sakura-server/minecraft-patches/features/0006-Store-Entity-Data-State.patch +++ b/sakura-server/minecraft-patches/features/0006-Store-Entity-Data-State.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Store Entity Data/State diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 5e48d84c5ab335975f6533472aec1e1789375bbf..597a776ef357fb1a12722ed64bf09bfbc6619265 100644 +index 63813792c1ae5a27cb42a0acb2c64d1a1e712a05..e37c8b3a4f00dfc6fde1e1fb05cd0bc0cc48377a 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -540,6 +540,21 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -541,6 +541,21 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return flags; } // Sakura end - load chunks on movement diff --git a/sakura-server/minecraft-patches/features/0007-Merge-Cannon-Entities.patch b/sakura-server/minecraft-patches/features/0007-Merge-Cannon-Entities.patch index a6f8d94..1e5de10 100644 --- a/sakura-server/minecraft-patches/features/0007-Merge-Cannon-Entities.patch +++ b/sakura-server/minecraft-patches/features/0007-Merge-Cannon-Entities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Merge Cannon Entities diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index 0604b5075122494ec82b4e1b458645958b93c806..8fec4a46a9cf13d832306bd87a4fe17be79bef86 100644 +index f2c0cd46a64fbc3fc7e6cb77acac353bb84d4073..dc0896f0b857451d6468589e8b44b1b22fa895d0 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java @@ -697,6 +697,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -41,10 +41,10 @@ index 0604b5075122494ec82b4e1b458645958b93c806..8fec4a46a9cf13d832306bd87a4fe17b this.guardEntityTick(this::tickNonPassenger, entity); profilerFiller.pop(); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 597a776ef357fb1a12722ed64bf09bfbc6619265..8ef66c8b9fae500049b778232ca4016092a9a9b3 100644 +index e37c8b3a4f00dfc6fde1e1fb05cd0bc0cc48377a..272801f1280da06d8e5894d7a3aedd432dfd0911 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -555,6 +555,24 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -556,6 +556,24 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return to.entityState() != null && to.entityState().comparePositionAndMotion(this); } // Sakura end - store entity data/state @@ -69,7 +69,7 @@ index 597a776ef357fb1a12722ed64bf09bfbc6619265..8ef66c8b9fae500049b778232ca40160 public Entity(EntityType entityType, Level level) { this.type = entityType; -@@ -4956,6 +4974,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -4957,6 +4975,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess if (this.removalReason != Entity.RemovalReason.UNLOADED_TO_CHUNK) { this.getPassengers().forEach(Entity::stopRiding); } // Paper - rewrite chunk system this.levelCallback.onRemove(removalReason); this.onRemoval(removalReason); diff --git a/sakura-server/minecraft-patches/features/0010-Specialised-Explosions.patch b/sakura-server/minecraft-patches/features/0010-Specialised-Explosions.patch index d0c9e09..5c73ee7 100644 --- a/sakura-server/minecraft-patches/features/0010-Specialised-Explosions.patch +++ b/sakura-server/minecraft-patches/features/0010-Specialised-Explosions.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Specialised Explosions diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index dce3331c7dbbf9bb6c6342d0a760c040342a2d0c..88b377a53159a473a43bdf06b78bfd3d4a2362a1 100644 +index a826ddc16ce9e646c6d552381ee85eaa4d523436..ce89182a48b7f89b2223407cc907f0572e777598 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -1869,7 +1869,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1871,7 +1871,16 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe case STANDARD -> Explosion.BlockInteraction.DESTROY; // CraftBukkit - handle custom explosion type }; Vec3 vec3 = new Vec3(x, y, z); @@ -26,7 +26,7 @@ index dce3331c7dbbf9bb6c6342d0a760c040342a2d0c..88b377a53159a473a43bdf06b78bfd3d if (configurator != null) configurator.accept(serverExplosion);// Paper - Allow explosions to damage source serverExplosion.explode(); // CraftBukkit start -@@ -1877,6 +1886,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1879,6 +1888,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe return serverExplosion; } // CraftBukkit end @@ -42,7 +42,7 @@ index dce3331c7dbbf9bb6c6342d0a760c040342a2d0c..88b377a53159a473a43bdf06b78bfd3d ParticleOptions particleOptions = serverExplosion.isSmall() ? smallExplosionParticles : largeExplosionParticles; for (ServerPlayer serverPlayer : this.players) { -@@ -1897,7 +1915,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1899,7 +1917,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe } } @@ -78,7 +78,7 @@ index e6aa1d1a5fc5cd2ffc156125c4eef2d0d1aeef4a..cb972f9d619c7acc8bbed4cc18513ad4 // Sakura end - merge cannon entities diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java -index 76697d12a12eeedbaab6aef169080320791aff6e..0285e19d6265056fb5ff9855a5dd41bd16bbc082 100644 +index bdd60268dfe82988fb9a86bb524706c807dac237..04a0f15e25e0746c638b8b01671adb579d0b0209 100644 --- a/net/minecraft/world/level/ServerExplosion.java +++ b/net/minecraft/world/level/ServerExplosion.java @@ -361,6 +361,38 @@ public class ServerExplosion implements Explosion { diff --git a/sakura-server/minecraft-patches/features/0011-Optimise-cannon-entity-movement.patch b/sakura-server/minecraft-patches/features/0011-Optimise-cannon-entity-movement.patch index 4700866..e5a3c47 100644 --- a/sakura-server/minecraft-patches/features/0011-Optimise-cannon-entity-movement.patch +++ b/sakura-server/minecraft-patches/features/0011-Optimise-cannon-entity-movement.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Optimise cannon entity movement diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 8ef66c8b9fae500049b778232ca4016092a9a9b3..2a73d2b49fff20abd282dd7f4ca0b4ee81f5a676 100644 +index 272801f1280da06d8e5894d7a3aedd432dfd0911..a1e65255f23ec2e3b2e3dfd9092fc16638493d92 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -1179,7 +1179,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1180,7 +1180,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess Vec3 vec3 = this.collide(movement); double d = vec3.lengthSqr(); if (d > 1.0E-7 || movement.lengthSqr() - d < 1.0E-7) { @@ -17,7 +17,7 @@ index 8ef66c8b9fae500049b778232ca4016092a9a9b3..2a73d2b49fff20abd282dd7f4ca0b4ee BlockHitResult blockHitResult = this.level() .clip( new ClipContext(this.position(), this.position().add(vec3), ClipContext.Block.FALLDAMAGE_RESETTING, ClipContext.Fluid.WATER, this) -@@ -1481,6 +1481,131 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1482,6 +1482,131 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return distance; } diff --git a/sakura-server/minecraft-patches/features/0013-Use-maxEntityCollision-limit-for-entity-retrieval.patch b/sakura-server/minecraft-patches/features/0013-Use-maxEntityCollision-limit-for-entity-retrieval.patch index fe5d493..7cb4853 100644 --- a/sakura-server/minecraft-patches/features/0013-Use-maxEntityCollision-limit-for-entity-retrieval.patch +++ b/sakura-server/minecraft-patches/features/0013-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 d19a1528203bb6efa774ac60de8d6f8b3ad15473..3aee2a479a2e82aee1974b7360b716bbdbd3b0c5 100644 +index e8f644873275a9cfa898066da23ab6805a6ac315..a67774ef5fdd619ea085b05113ab790da7c1caed 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -3639,7 +3639,16 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3657,7 +3657,16 @@ public abstract class LivingEntity extends Entity implements Attackable { return; } // Paper end - don't run getEntities if we're not going to use its result diff --git a/sakura-server/minecraft-patches/features/0016-Configure-cannon-physics.patch b/sakura-server/minecraft-patches/features/0016-Configure-cannon-physics.patch index 083cffa..34fdfe6 100644 --- a/sakura-server/minecraft-patches/features/0016-Configure-cannon-physics.patch +++ b/sakura-server/minecraft-patches/features/0016-Configure-cannon-physics.patch @@ -67,10 +67,10 @@ index 651a45b795818bd7b1364b95c52570fd99dd35e4..47c8ed946cb2ad81a4469daf60dabc40 if (xSmaller && z != 0.0) { z = performAABBCollisionsZ(axisalignedbb, z, aabbs); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 2a73d2b49fff20abd282dd7f4ca0b4ee81f5a676..12f3b0b555ab3f038d9ae8e49c340e95c874fed4 100644 +index a1e65255f23ec2e3b2e3dfd9092fc16638493d92..c74e20f1b20076e2eb289246f63d8363de2bc5e8 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -573,6 +573,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -574,6 +574,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } } // Sakura end - merge cannon entities @@ -84,7 +84,7 @@ index 2a73d2b49fff20abd282dd7f4ca0b4ee81f5a676..12f3b0b555ab3f038d9ae8e49c340e95 public Entity(EntityType entityType, Level level) { this.type = entityType; -@@ -1085,7 +1092,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1086,7 +1093,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } protected void checkSupportingBlock(boolean onGround, @Nullable Vec3 movement) { @@ -93,7 +93,7 @@ index 2a73d2b49fff20abd282dd7f4ca0b4ee81f5a676..12f3b0b555ab3f038d9ae8e49c340e95 AABB boundingBox = this.getBoundingBox(); AABB aabb = new AABB(boundingBox.minX, boundingBox.minY - 1.0E-6, boundingBox.minZ, boundingBox.maxX, boundingBox.minY, boundingBox.maxZ); Optional optional = this.level.findSupportingBlock(this, aabb); -@@ -1151,7 +1158,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1152,7 +1159,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); } else { this.wasOnFire = this.isOnFire(); @@ -105,7 +105,7 @@ index 2a73d2b49fff20abd282dd7f4ca0b4ee81f5a676..12f3b0b555ab3f038d9ae8e49c340e95 this.activatedTick = Math.max(this.activatedTick, MinecraftServer.currentTick + 20); // Paper - EAR 2 this.activatedImmunityTick = Math.max(this.activatedImmunityTick, MinecraftServer.currentTick + 20); // Paper - EAR 2 movement = this.limitPistonMovement(movement); -@@ -1178,8 +1188,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1179,8 +1189,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess movement = this.maybeBackOffFromEdge(movement, type); Vec3 vec3 = this.collide(movement); double d = vec3.lengthSqr(); @@ -119,7 +119,7 @@ index 2a73d2b49fff20abd282dd7f4ca0b4ee81f5a676..12f3b0b555ab3f038d9ae8e49c340e95 BlockHitResult blockHitResult = this.level() .clip( new ClipContext(this.position(), this.position().add(vec3), ClipContext.Block.FALLDAMAGE_RESETTING, ClipContext.Fluid.WATER, this) -@@ -1220,6 +1233,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1221,6 +1234,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } else { if (this.horizontalCollision) { Vec3 deltaMovement = this.getDeltaMovement(); @@ -132,7 +132,7 @@ index 2a73d2b49fff20abd282dd7f4ca0b4ee81f5a676..12f3b0b555ab3f038d9ae8e49c340e95 this.setDeltaMovement(flag ? 0.0 : deltaMovement.x, deltaMovement.y, flag1 ? 0.0 : deltaMovement.z); } -@@ -1510,7 +1529,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1511,7 +1530,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess bb = currBoundingBox.expandTowards(movement.x, movement.y, movement.z); } this.collectCollisions(bb, voxelList, bbList, ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.COLLISION_FLAG_CHECK_BORDER); @@ -141,7 +141,7 @@ index 2a73d2b49fff20abd282dd7f4ca0b4ee81f5a676..12f3b0b555ab3f038d9ae8e49c340e95 } private Vec3 collideAxisScan(Vec3 movement, AABB currBoundingBox, List voxelList, List bbList) { -@@ -1518,7 +1537,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1519,7 +1538,10 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess double y = movement.y; double z = movement.z; @@ -153,7 +153,7 @@ index 2a73d2b49fff20abd282dd7f4ca0b4ee81f5a676..12f3b0b555ab3f038d9ae8e49c340e95 if (y != 0.0) { y = this.scanY(currBoundingBox, y, voxelList, bbList); -@@ -1640,7 +1662,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1641,7 +1663,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.COLLISION_FLAG_CHECK_BORDER | this.getExtraCollisionFlags(), null // Sakura - load chunks on movement ); potentialCollisionsBB.addAll(entityAABBs); @@ -162,7 +162,7 @@ index 2a73d2b49fff20abd282dd7f4ca0b4ee81f5a676..12f3b0b555ab3f038d9ae8e49c340e95 final boolean collidedX = collided.x != movement.x; final boolean collidedY = collided.y != movement.y; -@@ -1799,9 +1821,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1800,9 +1822,17 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess for (Entity.Movement movement : movements) { Vec3 vec3 = movement.from(); Vec3 vec31 = movement.to(); @@ -421,7 +421,7 @@ index d23193d3f11505cea428414487f891ab584ad071..ffd96218e2ee84aae7a008ef1b95f84d // Paper end - Option to prevent TNT from moving in water } diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java -index 7b5a50ef269d0ca59fb067258421b53971a9998d..8aa4debbc68530670ba6329554da5e9cf8e64a71 100644 +index facca2c0d42598d16453f3e6c2dbb13f2696aba5..5dee39586c9d59bfcadbd7d97726a308812fca78 100644 --- a/net/minecraft/world/level/ServerExplosion.java +++ b/net/minecraft/world/level/ServerExplosion.java @@ -412,6 +412,7 @@ public class ServerExplosion implements Explosion { diff --git a/sakura-server/minecraft-patches/features/0018-Collide-with-non-solid-blocks.patch b/sakura-server/minecraft-patches/features/0018-Collide-with-non-solid-blocks.patch index c4aa9d7..7498b17 100644 --- a/sakura-server/minecraft-patches/features/0018-Collide-with-non-solid-blocks.patch +++ b/sakura-server/minecraft-patches/features/0018-Collide-with-non-solid-blocks.patch @@ -46,10 +46,10 @@ index 47c8ed946cb2ad81a4469daf60dabc40c5e8beda..16b66b19157081c7717f73ee3dc91116 mutablePos.set(blockX, blockY, blockZ); blockCollision = blockData.getCollisionShape(world, mutablePos, collisionShape); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 661f913bfa8a8bd0c4929a79745ea2e0f45098e4..a80fd65ea35590a992c6340a2f42f578afdaf1ab 100644 +index c74e20f1b20076e2eb289246f63d8363de2bc5e8..9a71820b766edd0b4d366735d96ae1241dba2047 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -537,6 +537,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -538,6 +538,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess flags |= ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.COLLISION_FLAG_ADD_TICKET; } diff --git a/sakura-server/minecraft-patches/features/0021-Add-entity-travel-distance-limits.patch b/sakura-server/minecraft-patches/features/0021-Add-entity-travel-distance-limits.patch index 46573e7..305f703 100644 --- a/sakura-server/minecraft-patches/features/0021-Add-entity-travel-distance-limits.patch +++ b/sakura-server/minecraft-patches/features/0021-Add-entity-travel-distance-limits.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add entity travel distance limits diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index 88b377a53159a473a43bdf06b78bfd3d4a2362a1..539c2e465d4c89584b5bccaad18fadc41db0643a 100644 +index ce89182a48b7f89b2223407cc907f0572e777598..36aee73d7dac26438f140c125ef8ee2fea3e7d74 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java -@@ -1295,6 +1295,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe +@@ -1296,6 +1296,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe final boolean isActive = io.papermc.paper.entity.activation.ActivationRange.checkIfActive(entity); // Paper - EAR 2 if (isActive) { // Paper - EAR 2 entity.tick(); @@ -21,10 +21,10 @@ index 88b377a53159a473a43bdf06b78bfd3d4a2362a1..539c2e465d4c89584b5bccaad18fadc4 } else {entity.inactiveTick();} // Paper - EAR 2 profilerFiller.pop(); diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index b894eb71fb9056f39d9d350b6ab78ce018ab4ef8..92be2dcb6411004ac7e58609224848e9d80f2b95 100644 +index 9a71820b766edd0b4d366735d96ae1241dba2047..b10b375a8ede214b0dd0615cb5625cd45e27b20e 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -588,6 +588,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -589,6 +589,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return this.physics; } // Sakura end - configure cannon physics @@ -44,7 +44,7 @@ index b894eb71fb9056f39d9d350b6ab78ce018ab4ef8..92be2dcb6411004ac7e58609224848e9 public Entity(EntityType entityType, Level level) { this.type = entityType; -@@ -617,6 +630,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -618,6 +631,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess this.setPos(0.0, 0.0, 0.0); this.eyeHeight = this.dimensions.eyeHeight(); this.despawnTime = type == EntityType.PLAYER ? -1 : level.paperConfig().entities.spawning.despawnTime.getOrDefault(type, io.papermc.paper.configuration.type.number.IntOr.Disabled.DISABLED).or(-1); // Paper - entity despawn time limit diff --git a/sakura-server/minecraft-patches/features/0023-Configurable-left-shooting-and-adjusting-limits.patch b/sakura-server/minecraft-patches/features/0023-Configurable-left-shooting-and-adjusting-limits.patch index 226da44..a32a9f3 100644 --- a/sakura-server/minecraft-patches/features/0023-Configurable-left-shooting-and-adjusting-limits.patch +++ b/sakura-server/minecraft-patches/features/0023-Configurable-left-shooting-and-adjusting-limits.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable left shooting and adjusting limits diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 92be2dcb6411004ac7e58609224848e9d80f2b95..371ca65ee7547ccd588ebdfae67588a31efc1bb3 100644 +index b10b375a8ede214b0dd0615cb5625cd45e27b20e..2dbf517562eb2f49d426697faaf02a126d7c6b0d 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -601,6 +601,46 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -602,6 +602,46 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return Math.max(x, z) >= this.travelDistanceLimit; } // Sakura end - entity travel distance limits @@ -55,7 +55,7 @@ index 92be2dcb6411004ac7e58609224848e9d80f2b95..371ca65ee7547ccd588ebdfae67588a3 public Entity(EntityType entityType, Level level) { this.type = entityType; -@@ -1572,6 +1612,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1573,6 +1613,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } if (xSmaller && z != 0.0) { @@ -63,7 +63,7 @@ index 92be2dcb6411004ac7e58609224848e9d80f2b95..371ca65ee7547ccd588ebdfae67588a3 z = this.scanZ(currBoundingBox, z, voxelList, bbList); if (z != 0.0) { currBoundingBox = ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.offsetZ(currBoundingBox, z); -@@ -1579,6 +1620,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1580,6 +1621,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess } if (x != 0.0) { diff --git a/sakura-server/minecraft-patches/features/0026-Optimise-check-inside-blocks-and-traverse-blocks.patch b/sakura-server/minecraft-patches/features/0026-Optimise-check-inside-blocks-and-traverse-blocks.patch index ffdde98..60b3e67 100644 --- a/sakura-server/minecraft-patches/features/0026-Optimise-check-inside-blocks-and-traverse-blocks.patch +++ b/sakura-server/minecraft-patches/features/0026-Optimise-check-inside-blocks-and-traverse-blocks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Optimise check inside blocks and traverse blocks diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 371ca65ee7547ccd588ebdfae67588a31efc1bb3..70bd9e730dbdbb7e99764be0e362b2e7a77f182a 100644 +index 2dbf517562eb2f49d426697faaf02a126d7c6b0d..f902dc11fc2797eab522edb175cc17bfa2a4cb94 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -1885,6 +1885,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1886,6 +1886,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess private void checkInsideBlocks(List movements, Set blocksInside) { if (this.isAffectedByBlocks()) { LongSet set = this.visitedBlocks; @@ -20,7 +20,7 @@ index 371ca65ee7547ccd588ebdfae67588a31efc1bb3..70bd9e730dbdbb7e99764be0e362b2e7 for (Entity.Movement movement : movements) { Vec3 vec3 = movement.from(); -@@ -1904,7 +1909,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess +@@ -1905,7 +1910,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess return; } diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch index 392e09d..adcf26a 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java -@@ -521,6 +_,7 @@ +@@ -522,6 +_,7 @@ } } // Paper end - optimise entity tracker @@ -8,7 +8,7 @@ public Entity(EntityType entityType, Level level) { this.type = entityType; -@@ -4021,7 +_,7 @@ +@@ -4022,7 +_,7 @@ } public boolean isPushedByFluid() { 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 899db6b..c979999 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 @@ -151,7 +151,7 @@ this.hurtArmor(damageSource, armorDamage); } -@@ -3269,6 +_,11 @@ +@@ -3285,6 +_,11 @@ if (this.level() instanceof ServerLevel serverLevel) { EnchantmentHelper.runLocationChangedEffects(serverLevel, itemBySlot, this, equipmentSlot1); } @@ -162,8 +162,8 @@ + // Sakura end - legacy combat mechanics } } - } -@@ -3492,7 +_,7 @@ + +@@ -3510,7 +_,7 @@ } } // Paper end - Add EntityMoveEvent @@ -172,7 +172,7 @@ this.hurtServer(serverLevel, this.damageSources().drown(), 1.0F); } } -@@ -4047,8 +_,16 @@ +@@ -4065,8 +_,16 @@ } public boolean isBlocking() { 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 6066b1d..dd0807a 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 @@ -57,7 +57,7 @@ + && (this.level().sakuraConfig().players.combat.legacyCombatMechanics || !this.isSprinting()); // Sakura - legacy combat mechanics flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits if (flag2) { - damageSource = damageSource.critical(true); // Paper start - critical damage API + damageSource = damageSource.critical(); // Paper - critical damage API @@ -1292,7 +_,21 @@ if (flag4) { float f4 = this.getKnockback(target, damageSource) + (flag1 ? 1.0F : 0.0F); @@ -90,7 +90,7 @@ float f5 = 1.0F + (float)this.getAttributeValue(Attributes.SWEEPING_DAMAGE_RATIO) * f; for (LivingEntity livingEntity2 : this.level() -@@ -1331,7 +_,7 @@ +@@ -1333,7 +_,7 @@ } // CraftBukkit end livingEntity2.knockback( @@ -99,7 +99,7 @@ , this, io.papermc.paper.event.entity.EntityKnockbackEvent.Cause.SWEEP_ATTACK // CraftBukkit // Paper - knockback events ); // CraftBukkit - moved up -@@ -1421,7 +_,7 @@ +@@ -1423,7 +_,7 @@ if (target instanceof LivingEntity) { float f7 = f3 - ((LivingEntity)target).getHealth(); this.awardStat(Stats.DAMAGE_DEALT, Math.round(f7 * 10.0F)); @@ -108,7 +108,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); -@@ -1824,6 +_,7 @@ +@@ -1826,6 +_,7 @@ // 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) { @@ -116,7 +116,7 @@ fromEntity.level().playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity itself if (fromEntity instanceof ServerPlayer serverPlayer) { serverPlayer.connection.send(new net.minecraft.network.protocol.game.ClientboundSoundPacket(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.wrapAsHolder(soundEffect), soundCategory, x, y, z, volume, pitch, fromEntity.random.nextLong())); -@@ -2210,7 +_,13 @@ +@@ -2212,7 +_,13 @@ @Override public EntityDimensions getDefaultDimensions(Pose pose) {