From d93e9766d3797d130f66179e70a1b374c546fef7 Mon Sep 17 00:00:00 2001 From: MC_XiaoHei Date: Tue, 12 Aug 2025 21:52:25 +0800 Subject: [PATCH] feat: merge old raid config, fix bugs (#680) --- ...ges.patch => 0106-Old-raid-behavior.patch} | 103 ++++++++++++++---- .../0113-Skippable-raid-height-check.patch | 19 ---- ....patch => 0113-Support-REI-protocol.patch} | 0 ...=> 0114-Vanilla-player-display-name.patch} | 0 ... => 0115-Fix-SculkCatalyst-exp-skip.patch} | 4 +- ...16-Vanilla-creative-pickup-behavior.patch} | 0 ...patch => 0117-Vanilla-portal-handle.patch} | 2 +- ...h => 0118-Fix-chunk-reload-detector.patch} | 0 ...not-reset-placed-block-on-exception.patch} | 2 +- ...ock-entity-and-entity-crash-at-Leve.patch} | 0 ... => 0121-Tripwire-behavior-modifier.patch} | 0 ...tch => 0122-Spawn-invulnerable-time.patch} | 2 +- ...ch => 0123-Old-zombie-reinforcement.patch} | 0 ...ch => 0124-Sound-update-suppression.patch} | 0 ...125-Old-zombie-piglin-drop-behavior.patch} | 0 ...b.patch => 0126-Fast-exp-orb-absorb.patch} | 0 ...patch => 0127-Vanilla-Fluid-Pushing.patch} | 0 ...0128-Configurable-item-damage-check.patch} | 2 +- ...Old-Throwable-Projectile-tick-order.patch} | 0 ...ld-leash-behavior-when-use-firework.patch} | 0 ...> 0131-Old-wet-tnt-explode-behavior.patch} | 0 ...2-Old-projectile-explosion-behavior.patch} | 0 ...tem-drops-due-to-update-suppression.patch} | 0 ...ce-desync-due-to-update-suppression.patch} | 2 +- ....patch => 0135-temp-fix-quick-craft.patch} | 2 +- ...nder-dragon-part-can-use-end-portal.patch} | 0 ...137-Configurable-collision-behavior.patch} | 0 ...tch => 0138-Chat-command-max-length.patch} | 0 ... 0139-Lithium-Sleeping-Block-Entity.patch} | 0 ...-Bring-back-LivingEntity-effect-CME.patch} | 2 +- ...-Remove-paper-stuck-poi-check-delay.patch} | 0 .../org/leavesmc/leaves/LeavesConfig.java | 29 +++-- 32 files changed, 105 insertions(+), 64 deletions(-) rename leaves-server/minecraft-patches/features/{0106-Revert-raid-changes.patch => 0106-Old-raid-behavior.patch} (63%) delete mode 100644 leaves-server/minecraft-patches/features/0113-Skippable-raid-height-check.patch rename leaves-server/minecraft-patches/features/{0114-Support-REI-protocol.patch => 0113-Support-REI-protocol.patch} (100%) rename leaves-server/minecraft-patches/features/{0115-Vanilla-player-display-name.patch => 0114-Vanilla-player-display-name.patch} (100%) rename leaves-server/minecraft-patches/features/{0116-Fix-SculkCatalyst-exp-skip.patch => 0115-Fix-SculkCatalyst-exp-skip.patch} (96%) rename leaves-server/minecraft-patches/features/{0117-Vanilla-creative-pickup-behavior.patch => 0116-Vanilla-creative-pickup-behavior.patch} (100%) rename leaves-server/minecraft-patches/features/{0118-Vanilla-portal-handle.patch => 0117-Vanilla-portal-handle.patch} (96%) rename leaves-server/minecraft-patches/features/{0119-Fix-chunk-reload-detector.patch => 0118-Fix-chunk-reload-detector.patch} (100%) rename leaves-server/minecraft-patches/features/{0120-Do-not-reset-placed-block-on-exception.patch => 0119-Do-not-reset-placed-block-on-exception.patch} (96%) rename leaves-server/minecraft-patches/features/{0121-Do-not-prevent-block-entity-and-entity-crash-at-Leve.patch => 0120-Do-not-prevent-block-entity-and-entity-crash-at-Leve.patch} (100%) rename leaves-server/minecraft-patches/features/{0122-Tripwire-behavior-modifier.patch => 0121-Tripwire-behavior-modifier.patch} (100%) rename leaves-server/minecraft-patches/features/{0123-Spawn-invulnerable-time.patch => 0122-Spawn-invulnerable-time.patch} (95%) rename leaves-server/minecraft-patches/features/{0124-Old-zombie-reinforcement.patch => 0123-Old-zombie-reinforcement.patch} (100%) rename leaves-server/minecraft-patches/features/{0125-Sound-update-suppression.patch => 0124-Sound-update-suppression.patch} (100%) rename leaves-server/minecraft-patches/features/{0126-Old-zombie-piglin-drop-behavior.patch => 0125-Old-zombie-piglin-drop-behavior.patch} (100%) rename leaves-server/minecraft-patches/features/{0127-Fast-exp-orb-absorb.patch => 0126-Fast-exp-orb-absorb.patch} (100%) rename leaves-server/minecraft-patches/features/{0128-Vanilla-Fluid-Pushing.patch => 0127-Vanilla-Fluid-Pushing.patch} (100%) rename leaves-server/minecraft-patches/features/{0129-Configurable-item-damage-check.patch => 0128-Configurable-item-damage-check.patch} (92%) rename leaves-server/minecraft-patches/features/{0130-Old-Throwable-Projectile-tick-order.patch => 0129-Old-Throwable-Projectile-tick-order.patch} (100%) rename leaves-server/minecraft-patches/features/{0131-Old-leash-behavior-when-use-firework.patch => 0130-Old-leash-behavior-when-use-firework.patch} (100%) rename leaves-server/minecraft-patches/features/{0132-Old-wet-tnt-explode-behavior.patch => 0131-Old-wet-tnt-explode-behavior.patch} (100%) rename leaves-server/minecraft-patches/features/{0133-Old-projectile-explosion-behavior.patch => 0132-Old-projectile-explosion-behavior.patch} (100%) rename leaves-server/minecraft-patches/features/{0134-Prevent-loss-of-item-drops-due-to-update-suppression.patch => 0133-Prevent-loss-of-item-drops-due-to-update-suppression.patch} (100%) rename leaves-server/minecraft-patches/features/{0135-Fix-block-place-desync-due-to-update-suppression.patch => 0134-Fix-block-place-desync-due-to-update-suppression.patch} (93%) rename leaves-server/minecraft-patches/features/{0136-temp-fix-quick-craft.patch => 0135-temp-fix-quick-craft.patch} (92%) rename leaves-server/minecraft-patches/features/{0137-Old-ender-dragon-part-can-use-end-portal.patch => 0136-Old-ender-dragon-part-can-use-end-portal.patch} (100%) rename leaves-server/minecraft-patches/features/{0138-Configurable-collision-behavior.patch => 0137-Configurable-collision-behavior.patch} (100%) rename leaves-server/minecraft-patches/features/{0139-Chat-command-max-length.patch => 0138-Chat-command-max-length.patch} (100%) rename leaves-server/minecraft-patches/features/{0140-Lithium-Sleeping-Block-Entity.patch => 0139-Lithium-Sleeping-Block-Entity.patch} (100%) rename leaves-server/minecraft-patches/features/{0141-Bring-back-LivingEntity-effect-CME.patch => 0140-Bring-back-LivingEntity-effect-CME.patch} (92%) rename leaves-server/minecraft-patches/features/{0142-Remove-paper-stuck-poi-check-delay.patch => 0141-Remove-paper-stuck-poi-check-delay.patch} (100%) diff --git a/leaves-server/minecraft-patches/features/0106-Revert-raid-changes.patch b/leaves-server/minecraft-patches/features/0106-Old-raid-behavior.patch similarity index 63% rename from leaves-server/minecraft-patches/features/0106-Revert-raid-changes.patch rename to leaves-server/minecraft-patches/features/0106-Old-raid-behavior.patch index 44713da5..7c442062 100644 --- a/leaves-server/minecraft-patches/features/0106-Revert-raid-changes.patch +++ b/leaves-server/minecraft-patches/features/0106-Old-raid-behavior.patch @@ -1,11 +1,11 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: huanli233 <392352840@qq.com> Date: Wed, 23 Oct 2024 23:10:48 +0800 -Subject: [PATCH] Revert raid changes +Subject: [PATCH] Old raid behavior diff --git a/net/minecraft/world/effect/BadOmenMobEffect.java b/net/minecraft/world/effect/BadOmenMobEffect.java -index 80f17f33f670018240c854df589cf90cdeab6e70..4c6ce6a4a730033802651b0c0052fc46edeed4d6 100644 +index 80f17f33f670018240c854df589cf90cdeab6e70..d7f443bcf91ac7817fe79881122960f49b331365 100644 --- a/net/minecraft/world/effect/BadOmenMobEffect.java +++ b/net/minecraft/world/effect/BadOmenMobEffect.java @@ -22,6 +22,11 @@ class BadOmenMobEffect extends MobEffect { @@ -13,7 +13,7 @@ index 80f17f33f670018240c854df589cf90cdeab6e70..4c6ce6a4a730033802651b0c0052fc46 && level.getDifficulty() != Difficulty.PEACEFUL && level.isVillage(serverPlayer.blockPosition())) { + // Leaves start - Revert raid changes -+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.allowBadOmenTriggerRaid) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior) { + return level.getRaids().createOrExtendRaid(serverPlayer, serverPlayer.blockPosition()) == null; + } + // Leaves end - Revert raid changes @@ -21,57 +21,68 @@ index 80f17f33f670018240c854df589cf90cdeab6e70..4c6ce6a4a730033802651b0c0052fc46 if (raidAt == null || raidAt.getRaidOmenLevel() < raidAt.getMaxRaidOmenLevel()) { serverPlayer.addEffect(new MobEffectInstance(MobEffects.RAID_OMEN, 600, amplifier)); diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java -index b3a29ce523fb5de71589c7c17598bba17622f988..b74ad31e5bcac5e557f18ccfb5c92d4d94a0ba6d 100644 +index b3a29ce523fb5de71589c7c17598bba17622f988..8f90f3234c9b80b7a194d5dbffd8ea93835dfc06 100644 --- a/net/minecraft/world/entity/raid/Raid.java +++ b/net/minecraft/world/entity/raid/Raid.java -@@ -333,7 +333,20 @@ public class Raid { +@@ -256,7 +256,7 @@ public class Raid { + } + + public boolean absorbRaidOmen(ServerPlayer player) { +- MobEffectInstance effect = player.getEffect(MobEffects.RAID_OMEN); ++ MobEffectInstance effect = player.getEffect(org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior ? MobEffects.BAD_OMEN : MobEffects.RAID_OMEN); // Leaves - old Raid Behavior + if (effect == null) { + return false; + } else { +@@ -333,7 +333,13 @@ public class Raid { } if (flag1) { - this.waveSpawnPos = this.getValidSpawnPos(level); + // Leaves Start - old FindSpawnPosition -+ if (!org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.useOldFindSpawnPosition) { -+ this.waveSpawnPos = this.getValidSpawnPos(level); ++ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior) { ++ this.waveSpawnPos = this.preCalcRavagerSpawnLocation(level, this.raidCooldownTicks < 100 ? 1 : 0); + } else { -+ int n4 = 0; -+ if (this.raidCooldownTicks < 100) { -+ n4 = 1; -+ } -+ if (this.raidCooldownTicks < 40) { -+ n4 = 2; -+ } -+ this.waveSpawnPos = this.getValidSpawnPos(level, n4); ++ this.waveSpawnPos = this.getValidSpawnPos(level); + } + // Leaves End - old FindSpawnPosition } if (this.raidCooldownTicks == 300 || this.raidCooldownTicks % 20 == 0) { -@@ -368,7 +381,14 @@ public class Raid { +@@ -368,7 +374,14 @@ public class Raid { int i = 0; while (this.shouldSpawnGroup()) { - BlockPos blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(level, 20)); + // Leaves Start - old FindSpawnPosition + BlockPos blockPos; -+ if (!org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.useOldFindSpawnPosition) { -+ blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(level, 20)); ++ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior) { ++ blockPos = this.getRavagerSpawnLocation(level, i, 20); + } else { -+ blockPos = this.waveSpawnPos.isPresent() ? this.waveSpawnPos.get() : this.findRandomSpawnPos(level, i, 20); ++ blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(level, 20)); + } + // Leaves End - old FindSpawnPosition if (blockPos != null) { this.started = true; this.spawnGroup(level, blockPos); -@@ -380,7 +400,7 @@ public class Raid { +@@ -380,7 +393,7 @@ public class Raid { i++; } - if (i > 5) { -+ if (i > (org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.useOldFindSpawnPosition ? 3 : 5)) { // Leaves - old FindSpawnPosition ++ if (i > (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior ? 3 : 5)) { // Leaves - old FindSpawnPosition org.bukkit.craftbukkit.event.CraftEventFactory.callRaidStopEvent(level, this, org.bukkit.event.raid.RaidStopEvent.Reason.UNSPAWNABLE); // CraftBukkit this.stop(); break; -@@ -686,6 +706,36 @@ public class Raid { +@@ -667,7 +680,7 @@ public class Raid { + int i2 = this.center.getX() + Mth.floor(Mth.cos(f2) * 32.0F * f) + level.random.nextInt(3) * Mth.floor(f); + int i3 = this.center.getZ() + Mth.floor(Mth.sin(f2) * 32.0F * f) + level.random.nextInt(3) * Mth.floor(f); + int height = level.getHeight(Heightmap.Types.WORLD_SURFACE, i2, i3); +- if (Mth.abs(height - this.center.getY()) <= 96) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior || Mth.abs(height - this.center.getY()) <= 96) { // Leaves - skippable + mutableBlockPos.set(i2, height, i3); + if (!level.isVillage(mutableBlockPos) || i <= 7) { + int i4 = 10; +@@ -686,6 +699,36 @@ public class Raid { return null; } @@ -108,8 +119,52 @@ index b3a29ce523fb5de71589c7c17598bba17622f988..b74ad31e5bcac5e557f18ccfb5c92d4d private boolean addWaveMob(ServerLevel level, int wave, Raider raider) { return this.addWaveMob(level, wave, raider, true); } +@@ -843,4 +886,43 @@ public class Raid { + this.spawnsPerWaveBeforeBonus = spawnsPerWaveBeforeBonus; + } + } ++ ++ // Leaves start - old FindSpawnPosition ++ private BlockPos getRavagerSpawnLocation(ServerLevel serverWorld, int proximity, int tries) { ++ int i = proximity == 0 ? 2 : 2 - proximity; ++ BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos(); ++ SpawnPlacementType spawnLocation = SpawnPlacements.getPlacementType(EntityType.RAVAGER); ++ ++ for (int j = 0; j < tries; j++) { ++ float f = serverWorld.random.nextFloat() * (float) (Math.PI * 2); ++ int k = this.center.getX() + Mth.floor(Mth.cos(f) * 32.0F * (float) i + serverWorld.random.nextInt(5)); ++ int l = this.center.getZ() + Mth.floor(Mth.sin(f) * 32.0F * (float) i + serverWorld.random.nextInt(5)); ++ int m = serverWorld.getHeight(Heightmap.Types.WORLD_SURFACE, k, l); ++ mutable.set(k, m, l); ++ ++ if (serverWorld.isVillage(mutable) && proximity < 2) { ++ continue; ++ } ++ if (serverWorld.hasChunksAt(mutable.getX() - 10, mutable.getZ() - 10, mutable.getX() + 10, mutable.getZ() + 10) ++ && serverWorld.isPositionEntityTicking(mutable) ++ && (spawnLocation.isSpawnPositionOk(serverWorld, mutable, EntityType.RAVAGER) ++ || serverWorld.getBlockState(mutable.below()).is(Blocks.SNOW) ++ && serverWorld.getBlockState(mutable).isAir()) ++ ) { ++ return mutable; ++ } ++ } ++ return null; ++ } ++ ++ private Optional preCalcRavagerSpawnLocation(ServerLevel serverWorld, int proximity) { ++ for (int i = 0; i < 3; i++) { ++ BlockPos blockPos = this.getRavagerSpawnLocation(serverWorld, proximity, 1); ++ if (blockPos != null) { ++ return Optional.of(blockPos); ++ } ++ } ++ return Optional.empty(); ++ } ++ // Leaves end - old FindSpawnPosition + } diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java -index 7b697f1dfe8131296ef55cd88a8b9d7cd884eb44..56995040e0bb23e55031cd1179faa770596e15a3 100644 +index 7b697f1dfe8131296ef55cd88a8b9d7cd884eb44..0e9cfb43d6620790f04b8a85e75308a306ec4ea5 100644 --- a/net/minecraft/world/entity/raid/Raider.java +++ b/net/minecraft/world/entity/raid/Raider.java @@ -128,6 +128,43 @@ public abstract class Raider extends PatrollingMonster { @@ -119,7 +174,7 @@ index 7b697f1dfe8131296ef55cd88a8b9d7cd884eb44..56995040e0bb23e55031cd1179faa770 + + // Leaves start - Revert raid changes + if (this.level() instanceof ServerLevel) { -+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.giveBadOmenWhenKillPatrolLeader && !this.hasRaid()) { ++ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.oldRaidBehavior && !this.hasRaid()) { + ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD); + net.minecraft.world.entity.player.Player entityhuman = null; + if (entity instanceof net.minecraft.world.entity.player.Player player) { diff --git a/leaves-server/minecraft-patches/features/0113-Skippable-raid-height-check.patch b/leaves-server/minecraft-patches/features/0113-Skippable-raid-height-check.patch deleted file mode 100644 index 2c0f3dcc..00000000 --- a/leaves-server/minecraft-patches/features/0113-Skippable-raid-height-check.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: violetc <58360096+s-yh-china@users.noreply.github.com> -Date: Fri, 14 Mar 2025 10:55:57 +0800 -Subject: [PATCH] Skippable raid height check - - -diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java -index b74ad31e5bcac5e557f18ccfb5c92d4d94a0ba6d..14cbc32c1ebb1eb777c9ae45ff5b2178b469dea2 100644 ---- a/net/minecraft/world/entity/raid/Raid.java -+++ b/net/minecraft/world/entity/raid/Raid.java -@@ -687,7 +687,7 @@ public class Raid { - int i2 = this.center.getX() + Mth.floor(Mth.cos(f2) * 32.0F * f) + level.random.nextInt(3) * Mth.floor(f); - int i3 = this.center.getZ() + Mth.floor(Mth.sin(f2) * 32.0F * f) + level.random.nextInt(3) * Mth.floor(f); - int height = level.getHeight(Heightmap.Types.WORLD_SURFACE, i2, i3); -- if (Mth.abs(height - this.center.getY()) <= 96) { -+ if (org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.skipHeightCheck || Mth.abs(height - this.center.getY()) <= 96) { // Leaves - skippable - mutableBlockPos.set(i2, height, i3); - if (!level.isVillage(mutableBlockPos) || i <= 7) { - int i4 = 10; diff --git a/leaves-server/minecraft-patches/features/0114-Support-REI-protocol.patch b/leaves-server/minecraft-patches/features/0113-Support-REI-protocol.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0114-Support-REI-protocol.patch rename to leaves-server/minecraft-patches/features/0113-Support-REI-protocol.patch diff --git a/leaves-server/minecraft-patches/features/0115-Vanilla-player-display-name.patch b/leaves-server/minecraft-patches/features/0114-Vanilla-player-display-name.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0115-Vanilla-player-display-name.patch rename to leaves-server/minecraft-patches/features/0114-Vanilla-player-display-name.patch diff --git a/leaves-server/minecraft-patches/features/0116-Fix-SculkCatalyst-exp-skip.patch b/leaves-server/minecraft-patches/features/0115-Fix-SculkCatalyst-exp-skip.patch similarity index 96% rename from leaves-server/minecraft-patches/features/0116-Fix-SculkCatalyst-exp-skip.patch rename to leaves-server/minecraft-patches/features/0115-Fix-SculkCatalyst-exp-skip.patch index 87da5974..3d68aa18 100644 --- a/leaves-server/minecraft-patches/features/0116-Fix-SculkCatalyst-exp-skip.patch +++ b/leaves-server/minecraft-patches/features/0115-Fix-SculkCatalyst-exp-skip.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix SculkCatalyst exp skip diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index b093ceec2eb02fc3f069874fb828848284991e81..a659b9ecf2786dcc21b9d64d90e25f300847458e 100644 +index 70b35fa479bdfcda2f404b3b86547552f7d6da8e..eb391c3ef663ea0267c90a8e46a658e4390040d4 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java @@ -1105,7 +1105,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc @@ -34,7 +34,7 @@ index b093ceec2eb02fc3f069874fb828848284991e81..a659b9ecf2786dcc21b9d64d90e25f30 AABB aabb = new AABB(this.blockPosition()).inflate(32.0, 10.0, 32.0); this.level() diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 557d388297f15964547701352976b085f529e402..7cab027953d92b89ea6233b15491e07f24fb9519 100644 +index 2cc5c081a75997be637fe753ccdd222e862170c0..e3673ababa41a4d65b87adbc6d79d53a196564b7 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -277,6 +277,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin diff --git a/leaves-server/minecraft-patches/features/0117-Vanilla-creative-pickup-behavior.patch b/leaves-server/minecraft-patches/features/0116-Vanilla-creative-pickup-behavior.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0117-Vanilla-creative-pickup-behavior.patch rename to leaves-server/minecraft-patches/features/0116-Vanilla-creative-pickup-behavior.patch diff --git a/leaves-server/minecraft-patches/features/0118-Vanilla-portal-handle.patch b/leaves-server/minecraft-patches/features/0117-Vanilla-portal-handle.patch similarity index 96% rename from leaves-server/minecraft-patches/features/0118-Vanilla-portal-handle.patch rename to leaves-server/minecraft-patches/features/0117-Vanilla-portal-handle.patch index 206c86c9..ba11af62 100644 --- a/leaves-server/minecraft-patches/features/0118-Vanilla-portal-handle.patch +++ b/leaves-server/minecraft-patches/features/0117-Vanilla-portal-handle.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Vanilla portal handle diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java -index 47b9ddcecd0853927a4a41264bda15a935b55671..0dde70f12ede6da06a0b9f0e78272a963a167699 100644 +index f5ed9965394eb075faf92515181c2446981e24a2..0a29cf071cefe14f1862d4bd5ddcacff42fe9f15 100644 --- a/net/minecraft/world/entity/Entity.java +++ b/net/minecraft/world/entity/Entity.java @@ -836,6 +836,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess diff --git a/leaves-server/minecraft-patches/features/0119-Fix-chunk-reload-detector.patch b/leaves-server/minecraft-patches/features/0118-Fix-chunk-reload-detector.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0119-Fix-chunk-reload-detector.patch rename to leaves-server/minecraft-patches/features/0118-Fix-chunk-reload-detector.patch diff --git a/leaves-server/minecraft-patches/features/0120-Do-not-reset-placed-block-on-exception.patch b/leaves-server/minecraft-patches/features/0119-Do-not-reset-placed-block-on-exception.patch similarity index 96% rename from leaves-server/minecraft-patches/features/0120-Do-not-reset-placed-block-on-exception.patch rename to leaves-server/minecraft-patches/features/0119-Do-not-reset-placed-block-on-exception.patch index 4bd2ee6d..11a77121 100644 --- a/leaves-server/minecraft-patches/features/0120-Do-not-reset-placed-block-on-exception.patch +++ b/leaves-server/minecraft-patches/features/0119-Do-not-reset-placed-block-on-exception.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Do not reset placed block on exception diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java -index 17e35aa9efc55a52ad64f05e8fdc3c7fae3ef0c4..699a0fe62204f0f4b9677ec1e0d894b918b7aef9 100644 +index 593e65ef3a768d4039047e42e666c8382a5d38eb..cf143589407dc2146c9ce18f509077017fba0b48 100644 --- a/net/minecraft/world/item/BlockItem.java +++ b/net/minecraft/world/item/BlockItem.java @@ -92,20 +92,22 @@ public class BlockItem extends Item { diff --git a/leaves-server/minecraft-patches/features/0121-Do-not-prevent-block-entity-and-entity-crash-at-Leve.patch b/leaves-server/minecraft-patches/features/0120-Do-not-prevent-block-entity-and-entity-crash-at-Leve.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0121-Do-not-prevent-block-entity-and-entity-crash-at-Leve.patch rename to leaves-server/minecraft-patches/features/0120-Do-not-prevent-block-entity-and-entity-crash-at-Leve.patch diff --git a/leaves-server/minecraft-patches/features/0122-Tripwire-behavior-modifier.patch b/leaves-server/minecraft-patches/features/0121-Tripwire-behavior-modifier.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0122-Tripwire-behavior-modifier.patch rename to leaves-server/minecraft-patches/features/0121-Tripwire-behavior-modifier.patch diff --git a/leaves-server/minecraft-patches/features/0123-Spawn-invulnerable-time.patch b/leaves-server/minecraft-patches/features/0122-Spawn-invulnerable-time.patch similarity index 95% rename from leaves-server/minecraft-patches/features/0123-Spawn-invulnerable-time.patch rename to leaves-server/minecraft-patches/features/0122-Spawn-invulnerable-time.patch index c65044a2..0c02b16b 100644 --- a/leaves-server/minecraft-patches/features/0123-Spawn-invulnerable-time.patch +++ b/leaves-server/minecraft-patches/features/0122-Spawn-invulnerable-time.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Spawn invulnerable time diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java -index a659b9ecf2786dcc21b9d64d90e25f300847458e..2860c18c95a45005f21024793d0e25400269b911 100644 +index eb391c3ef663ea0267c90a8e46a658e4390040d4..0002efa90e736c48fbfcd365eb0c0c78d7e1def1 100644 --- a/net/minecraft/server/level/ServerPlayer.java +++ b/net/minecraft/server/level/ServerPlayer.java @@ -232,6 +232,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc diff --git a/leaves-server/minecraft-patches/features/0124-Old-zombie-reinforcement.patch b/leaves-server/minecraft-patches/features/0123-Old-zombie-reinforcement.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0124-Old-zombie-reinforcement.patch rename to leaves-server/minecraft-patches/features/0123-Old-zombie-reinforcement.patch diff --git a/leaves-server/minecraft-patches/features/0125-Sound-update-suppression.patch b/leaves-server/minecraft-patches/features/0124-Sound-update-suppression.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0125-Sound-update-suppression.patch rename to leaves-server/minecraft-patches/features/0124-Sound-update-suppression.patch diff --git a/leaves-server/minecraft-patches/features/0126-Old-zombie-piglin-drop-behavior.patch b/leaves-server/minecraft-patches/features/0125-Old-zombie-piglin-drop-behavior.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0126-Old-zombie-piglin-drop-behavior.patch rename to leaves-server/minecraft-patches/features/0125-Old-zombie-piglin-drop-behavior.patch diff --git a/leaves-server/minecraft-patches/features/0127-Fast-exp-orb-absorb.patch b/leaves-server/minecraft-patches/features/0126-Fast-exp-orb-absorb.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0127-Fast-exp-orb-absorb.patch rename to leaves-server/minecraft-patches/features/0126-Fast-exp-orb-absorb.patch diff --git a/leaves-server/minecraft-patches/features/0128-Vanilla-Fluid-Pushing.patch b/leaves-server/minecraft-patches/features/0127-Vanilla-Fluid-Pushing.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0128-Vanilla-Fluid-Pushing.patch rename to leaves-server/minecraft-patches/features/0127-Vanilla-Fluid-Pushing.patch diff --git a/leaves-server/minecraft-patches/features/0129-Configurable-item-damage-check.patch b/leaves-server/minecraft-patches/features/0128-Configurable-item-damage-check.patch similarity index 92% rename from leaves-server/minecraft-patches/features/0129-Configurable-item-damage-check.patch rename to leaves-server/minecraft-patches/features/0128-Configurable-item-damage-check.patch index 8767e590..589acc5f 100644 --- a/leaves-server/minecraft-patches/features/0129-Configurable-item-damage-check.patch +++ b/leaves-server/minecraft-patches/features/0128-Configurable-item-damage-check.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable item damage check diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java -index 3ba64f91883b88f3131d4582c771b511bbccfcd9..73c1972470ef19fe7fff0ed17d6ff40fe8bed38b 100644 +index 31b5dd406de54636fd0b86e031ce247abbcde063..e59b8d42d602bbdae1071f2a5be1180420c4efb7 100644 --- a/net/minecraft/world/item/ItemStack.java +++ b/net/minecraft/world/item/ItemStack.java @@ -597,11 +597,11 @@ public final class ItemStack implements DataComponentHolder { diff --git a/leaves-server/minecraft-patches/features/0130-Old-Throwable-Projectile-tick-order.patch b/leaves-server/minecraft-patches/features/0129-Old-Throwable-Projectile-tick-order.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0130-Old-Throwable-Projectile-tick-order.patch rename to leaves-server/minecraft-patches/features/0129-Old-Throwable-Projectile-tick-order.patch diff --git a/leaves-server/minecraft-patches/features/0131-Old-leash-behavior-when-use-firework.patch b/leaves-server/minecraft-patches/features/0130-Old-leash-behavior-when-use-firework.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0131-Old-leash-behavior-when-use-firework.patch rename to leaves-server/minecraft-patches/features/0130-Old-leash-behavior-when-use-firework.patch diff --git a/leaves-server/minecraft-patches/features/0132-Old-wet-tnt-explode-behavior.patch b/leaves-server/minecraft-patches/features/0131-Old-wet-tnt-explode-behavior.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0132-Old-wet-tnt-explode-behavior.patch rename to leaves-server/minecraft-patches/features/0131-Old-wet-tnt-explode-behavior.patch diff --git a/leaves-server/minecraft-patches/features/0133-Old-projectile-explosion-behavior.patch b/leaves-server/minecraft-patches/features/0132-Old-projectile-explosion-behavior.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0133-Old-projectile-explosion-behavior.patch rename to leaves-server/minecraft-patches/features/0132-Old-projectile-explosion-behavior.patch diff --git a/leaves-server/minecraft-patches/features/0134-Prevent-loss-of-item-drops-due-to-update-suppression.patch b/leaves-server/minecraft-patches/features/0133-Prevent-loss-of-item-drops-due-to-update-suppression.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0134-Prevent-loss-of-item-drops-due-to-update-suppression.patch rename to leaves-server/minecraft-patches/features/0133-Prevent-loss-of-item-drops-due-to-update-suppression.patch diff --git a/leaves-server/minecraft-patches/features/0135-Fix-block-place-desync-due-to-update-suppression.patch b/leaves-server/minecraft-patches/features/0134-Fix-block-place-desync-due-to-update-suppression.patch similarity index 93% rename from leaves-server/minecraft-patches/features/0135-Fix-block-place-desync-due-to-update-suppression.patch rename to leaves-server/minecraft-patches/features/0134-Fix-block-place-desync-due-to-update-suppression.patch index b3a5e897..9bae9e55 100644 --- a/leaves-server/minecraft-patches/features/0135-Fix-block-place-desync-due-to-update-suppression.patch +++ b/leaves-server/minecraft-patches/features/0134-Fix-block-place-desync-due-to-update-suppression.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix block place desync due to update suppression diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java -index 73c1972470ef19fe7fff0ed17d6ff40fe8bed38b..fdc92174fcb4f56fb4ff056f04c9b2429061d887 100644 +index e59b8d42d602bbdae1071f2a5be1180420c4efb7..1186cad641786aff2ea6f664724a53511aa1440e 100644 --- a/net/minecraft/world/item/ItemStack.java +++ b/net/minecraft/world/item/ItemStack.java @@ -389,8 +389,12 @@ public final class ItemStack implements DataComponentHolder { diff --git a/leaves-server/minecraft-patches/features/0136-temp-fix-quick-craft.patch b/leaves-server/minecraft-patches/features/0135-temp-fix-quick-craft.patch similarity index 92% rename from leaves-server/minecraft-patches/features/0136-temp-fix-quick-craft.patch rename to leaves-server/minecraft-patches/features/0135-temp-fix-quick-craft.patch index f983d182..c6ee8526 100644 --- a/leaves-server/minecraft-patches/features/0136-temp-fix-quick-craft.patch +++ b/leaves-server/minecraft-patches/features/0135-temp-fix-quick-craft.patch @@ -7,7 +7,7 @@ caused by PaperMC/Paper#11765 should remove when PaperMC/Paper#11831 merged diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 7cab027953d92b89ea6233b15491e07f24fb9519..72ac89d349db718125cfb9aac6453c2cba708919 100644 +index e3673ababa41a4d65b87adbc6d79d53a196564b7..6c9a7ae3e9a340de35ca4dfcd486cfe5818d2aa5 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -3945,11 +3945,11 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin diff --git a/leaves-server/minecraft-patches/features/0137-Old-ender-dragon-part-can-use-end-portal.patch b/leaves-server/minecraft-patches/features/0136-Old-ender-dragon-part-can-use-end-portal.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0137-Old-ender-dragon-part-can-use-end-portal.patch rename to leaves-server/minecraft-patches/features/0136-Old-ender-dragon-part-can-use-end-portal.patch diff --git a/leaves-server/minecraft-patches/features/0138-Configurable-collision-behavior.patch b/leaves-server/minecraft-patches/features/0137-Configurable-collision-behavior.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0138-Configurable-collision-behavior.patch rename to leaves-server/minecraft-patches/features/0137-Configurable-collision-behavior.patch diff --git a/leaves-server/minecraft-patches/features/0139-Chat-command-max-length.patch b/leaves-server/minecraft-patches/features/0138-Chat-command-max-length.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0139-Chat-command-max-length.patch rename to leaves-server/minecraft-patches/features/0138-Chat-command-max-length.patch diff --git a/leaves-server/minecraft-patches/features/0140-Lithium-Sleeping-Block-Entity.patch b/leaves-server/minecraft-patches/features/0139-Lithium-Sleeping-Block-Entity.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0140-Lithium-Sleeping-Block-Entity.patch rename to leaves-server/minecraft-patches/features/0139-Lithium-Sleeping-Block-Entity.patch diff --git a/leaves-server/minecraft-patches/features/0141-Bring-back-LivingEntity-effect-CME.patch b/leaves-server/minecraft-patches/features/0140-Bring-back-LivingEntity-effect-CME.patch similarity index 92% rename from leaves-server/minecraft-patches/features/0141-Bring-back-LivingEntity-effect-CME.patch rename to leaves-server/minecraft-patches/features/0140-Bring-back-LivingEntity-effect-CME.patch index 09738eac..7b8d4d49 100644 --- a/leaves-server/minecraft-patches/features/0141-Bring-back-LivingEntity-effect-CME.patch +++ b/leaves-server/minecraft-patches/features/0140-Bring-back-LivingEntity-effect-CME.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Bring back LivingEntity effect CME diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java -index 72ac89d349db718125cfb9aac6453c2cba708919..817b55dfb131b0892a670df1ad00d892b855bf0e 100644 +index 6c9a7ae3e9a340de35ca4dfcd486cfe5818d2aa5..782138474b1b2fab525de607f542f621ca92a0e8 100644 --- a/net/minecraft/world/entity/LivingEntity.java +++ b/net/minecraft/world/entity/LivingEntity.java @@ -1151,7 +1151,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin diff --git a/leaves-server/minecraft-patches/features/0142-Remove-paper-stuck-poi-check-delay.patch b/leaves-server/minecraft-patches/features/0141-Remove-paper-stuck-poi-check-delay.patch similarity index 100% rename from leaves-server/minecraft-patches/features/0142-Remove-paper-stuck-poi-check-delay.patch rename to leaves-server/minecraft-patches/features/0141-Remove-paper-stuck-poi-check-delay.patch diff --git a/leaves-server/src/main/java/org/leavesmc/leaves/LeavesConfig.java b/leaves-server/src/main/java/org/leavesmc/leaves/LeavesConfig.java index 9471232f..6e5842b7 100644 --- a/leaves-server/src/main/java/org/leavesmc/leaves/LeavesConfig.java +++ b/leaves-server/src/main/java/org/leavesmc/leaves/LeavesConfig.java @@ -8,6 +8,7 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.entity.player.Player; import org.bukkit.command.Command; +import org.bukkit.configuration.MemorySection; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.permissions.Permission; import org.bukkit.permissions.PermissionDefault; @@ -17,6 +18,7 @@ import org.leavesmc.leaves.bot.BotCommand; import org.leavesmc.leaves.bot.ServerBot; import org.leavesmc.leaves.bot.agent.Actions; import org.leavesmc.leaves.command.LeavesCommand; +import org.leavesmc.leaves.config.ConfigTransformer; import org.leavesmc.leaves.config.ConfigValidatorImpl.BooleanConfigValidator; import org.leavesmc.leaves.config.ConfigValidatorImpl.DoubleConfigValidator; import org.leavesmc.leaves.config.ConfigValidatorImpl.EnumConfigValidator; @@ -335,21 +337,24 @@ public final class LeavesConfig { @GlobalConfig("old-zombie-piglin-drop") public boolean oldZombiePiglinDrop = false; - public RaidConfig raid = new RaidConfig(); + @RemovedConfig(name = "revert-raid-changes", category = {"modify", "minecraft-old"}, transform = true, transformer = RaidConfigTransformer.class) + @GlobalConfig("old-raid-behavior") + public boolean oldRaidBehavior = false; - @GlobalConfigCategory("revert-raid-changes") - public static class RaidConfig { - @GlobalConfig("allow-bad-omen-trigger-raid") - public boolean allowBadOmenTriggerRaid = false; + public static class RaidConfigTransformer implements ConfigTransformer { - @GlobalConfig("give-bad-omen-when-kill-patrol-leader") - public boolean giveBadOmenWhenKillPatrolLeader = false; + @Override + public Boolean transform(@NotNull MemorySection raidConfig) { + return raidConfig.getBoolean("allow-bad-omen-trigger-raid") + || raidConfig.getBoolean("give-bad-omen-when-kill-patrol-leader") + || raidConfig.getBoolean("skip-height-check") + || raidConfig.getBoolean("use-old-find-spawn-position"); + } - @GlobalConfig("use-old-find-spawn-position") - public boolean useOldFindSpawnPosition = false; - - @GlobalConfig("skip-height-check") - public boolean skipHeightCheck = false; + @Override + public MemorySection stringConvert(String value) throws IllegalArgumentException { + return null; + } } @GlobalConfig("old-zombie-reinforcement")