From 6c49e8527f89d6c389dd51a1818c020600fcf931 Mon Sep 17 00:00:00 2001 From: Samsuik Date: Thu, 6 Mar 2025 17:47:12 +0000 Subject: [PATCH] Updated Upstream (Paper) Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@5e2a3bc Call EntityChangeBlockEvent with correct block when waxing (#12154) PaperMC/Paper@ab984a0 Always pass event block to damage source (#12158) PaperMC/Paper@7b4d44f Revert "Always pass event block to damage source (#12158)" PaperMC/Paper@e5a8ee8 Hide soul speed particles for vanished players (#12152) PaperMC/Paper@fcb2e81 Clear lastSection on game event listener removal PaperMC/Paper@636ae0c Add missing Paper comments to player movement patch PaperMC/Paper@9be4e07 Pin snapshot dependencies (#12185) PaperMC/Paper@f12d33f Track codec writing PaperMC/Paper@1d9b399 Add config option for failed beehive release cooldowns (#12186) PaperMC/Paper@5f2ee83 Fix first execution of async delayed/repeating tasks being sync (#12166) PaperMC/Paper@b00875f Add a method on Registry to get the size (#12182) PaperMC/Paper@ca26109 Don't process empty rcon commands (#12188) PaperMC/Paper@a501c45 Deprecate server config getters (#12189) PaperMC/Paper@7f3d359 Use MiniMessage#deserialize(String, Pointered) in sendRichMessage for send messages (#12177) PaperMC/Paper@9b9f046 Remove broken code (#12171) PaperMC/Paper@fc56c72 Add methods for Creaking (#12094) PaperMC/Paper@f63dbea Fix cancelled HangingPlaceEvent inventory desync (#12161) PaperMC/Paper@9421f22 Make CustomArgumentType use parse(reader,source) (#12191) PaperMC/Paper@0a6e743 Fix invulnerability damage and armour (#12190) PaperMC/Paper@b506626 Remove unused light queue size option (#12201) PaperMC/Paper@1d5e5a5 Document replacement for Skull owner profile methods (#12195) PaperMC/Paper@8de7e35 Add null check to level ref in Entity constructor (#12218) PaperMC/Paper@a866e36 Fix MenuType.SMITHING JavaDocs (#12226) PaperMC/Paper@5538d24 Fix "DEFAULT" SpawnReason of fish spawned by bucket (#12227) --- gradle.properties | 2 +- ...ityCollision-limit-for-entity-retrieval.patch | 4 ++-- .../0021-Add-entity-travel-distance-limits.patch | 8 ++++---- .../world/entity/LivingEntity.java.patch | 16 ++++++++-------- .../entity/projectile/ThrownPotion.java.patch | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gradle.properties b/gradle.properties index f29a8b5..f4d383a 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=edda0db18b0c9b0304e06fb167b218d1e1cf8d55 +paperRef=5538d24d72a418491b80e89d6f7710548ac46687 org.gradle.jvmargs=-Xmx2G org.gradle.vfs.watch=false 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 7cb4853..22fcc64 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 e8f644873275a9cfa898066da23ab6805a6ac315..a67774ef5fdd619ea085b05113ab790da7c1caed 100644 +index 430fefb29456dab44241d40c470ebef5fa25bb4b..647dbf5a268250c7b1c3824089dd11f6e1cec37c 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java -@@ -3657,7 +3657,16 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -3664,7 +3664,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/0021-Add-entity-travel-distance-limits.patch b/sakura-server/minecraft-patches/features/0021-Add-entity-travel-distance-limits.patch index 305f703..347db3c 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,7 +5,7 @@ Subject: [PATCH] Add entity travel distance limits diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java -index ce89182a48b7f89b2223407cc907f0572e777598..36aee73d7dac26438f140c125ef8ee2fea3e7d74 100644 +index 512486514d2279c377b0fb6fd2a90b03c89d2209..0b575c9acf7e211bf62fde3bf9e82d6bdeb0f643 100644 --- a/net/minecraft/server/level/ServerLevel.java +++ b/net/minecraft/server/level/ServerLevel.java @@ -1296,6 +1296,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe @@ -21,7 +21,7 @@ index ce89182a48b7f89b2223407cc907f0572e777598..36aee73d7dac26438f140c125ef8ee2f } 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 9a71820b766edd0b4d366735d96ae1241dba2047..b10b375a8ede214b0dd0615cb5625cd45e27b20e 100644 +index 15e54f3ddb12c392d4527661a2672a6856b14215..01c43ee5497037cb059255cc31d85f04dbfa78ed 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -589,6 +589,19 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess @@ -47,8 +47,8 @@ index 9a71820b766edd0b4d366735d96ae1241dba2047..b10b375a8ede214b0dd0615cb5625cd4 @@ -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 -+ this.travelDistanceLimit = Math.pow(this.level.sakuraConfig().entity.chunkTravelLimit.getOrDefault(this.type, Integer.MAX_VALUE) * 16.0, 2); // Sakura - entity travel distance limits + this.despawnTime = level == null || 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 ++ this.travelDistanceLimit = level == null ? Integer.MAX_VALUE : Math.pow(level.sakuraConfig().entity.chunkTravelLimit.getOrDefault(entityType, Integer.MAX_VALUE) * 16.0, 2); // Sakura - entity travel distance limits } public boolean isColliding(BlockPos pos, BlockState state) { 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 c979999..b48af99 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 @@ -126,7 +126,7 @@ } return damageAmount; -@@ -2248,6 +_,11 @@ +@@ -2252,6 +_,11 @@ com.google.common.base.Function blocking = new com.google.common.base.Function() { @Override public Double apply(Double f) { @@ -138,10 +138,10 @@ return -((LivingEntity.this.isDamageSourceBlocked(damagesource)) ? f : 0.0); } }; -@@ -2344,6 +_,12 @@ - // Apply damage to armor - if (!damageSource.is(DamageTypeTags.BYPASSES_ARMOR)) { - float armorDamage = (float) (event.getDamage() + event.getDamage(DamageModifier.BLOCKING) + event.getDamage(DamageModifier.HARD_HAT)); +@@ -2351,6 +_,12 @@ + armorDamage += (float) event.getDamage(DamageModifier.INVULNERABILITY_REDUCTION); + armorDamage += (float) event.getDamage(DamageModifier.BLOCKING); + armorDamage += (float) event.getDamage(DamageModifier.HARD_HAT); + // Sakura start - add max armour durability damage + final int maxArmourDamage = this.level().sakuraConfig().players.combat.maxArmourDamage.or(-1); + if (maxArmourDamage >= 0) { @@ -151,7 +151,7 @@ this.hurtArmor(damageSource, armorDamage); } -@@ -3285,6 +_,11 @@ +@@ -3292,6 +_,11 @@ if (this.level() instanceof ServerLevel serverLevel) { EnchantmentHelper.runLocationChangedEffects(serverLevel, itemBySlot, this, equipmentSlot1); } @@ -163,7 +163,7 @@ } } -@@ -3510,7 +_,7 @@ +@@ -3517,7 +_,7 @@ } } // Paper end - Add EntityMoveEvent @@ -172,7 +172,7 @@ this.hurtServer(serverLevel, this.damageSources().drown(), 1.0F); } } -@@ -4065,8 +_,16 @@ +@@ -4072,8 +_,16 @@ } public boolean isBlocking() { diff --git a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ThrownPotion.java.patch b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ThrownPotion.java.patch index 6857438..3ebce33 100644 --- a/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ThrownPotion.java.patch +++ b/sakura-server/minecraft-patches/sources/net/minecraft/world/entity/projectile/ThrownPotion.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/ThrownPotion.java +++ b/net/minecraft/world/entity/projectile/ThrownPotion.java -@@ -49,6 +_,25 @@ +@@ -48,6 +_,25 @@ public ThrownPotion(Level level, double x, double y, double z, ItemStack item) { super(EntityType.POTION, x, y, z, level, item); }