diff --git a/leaves-server/minecraft-patches/features/0032-Stackable-ShulkerBoxes.patch b/leaves-server/minecraft-patches/features/0032-Stackable-ShulkerBoxes.patch index 92a26a4c..ccbf6310 100644 --- a/leaves-server/minecraft-patches/features/0032-Stackable-ShulkerBoxes.patch +++ b/leaves-server/minecraft-patches/features/0032-Stackable-ShulkerBoxes.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Stackable ShulkerBoxes This patch is Powered by fabric-carpet(https://github.com/gnembon/fabric-carpet) and plusls-carpet-addition(https://github.com/plusls/plusls-carpet-addition) diff --git a/net/minecraft/commands/arguments/item/ItemInput.java b/net/minecraft/commands/arguments/item/ItemInput.java -index 643797124fe5a4489d0b7419b7e600c04f283ef2..44c10be00cc4265ea6688f9a1093ee7c9f6f50f1 100644 +index 643797124fe5a4489d0b7419b7e600c04f283ef2..51971a4ef18ab048dc576c26652982d57e440dc0 100644 --- a/net/minecraft/commands/arguments/item/ItemInput.java +++ b/net/minecraft/commands/arguments/item/ItemInput.java @@ -39,11 +39,13 @@ public class ItemInput { @@ -496,7 +496,7 @@ index 42a29e700d2549de7cd905c373212e9757bcfcf1..3122753c96e98e57fa900cd15005ab48 - stack.limitSize(this.getMaxStackSize(stack)); + stack.limitSize(this.getMaxStackLeaves(stack)); // Leaves - stackable shulker boxes } - + @Override @@ -688,9 +688,9 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen if (item.isEmpty()) { diff --git a/leaves-server/minecraft-patches/features/0108-Revert-raid-changes.patch b/leaves-server/minecraft-patches/features/0108-Revert-raid-changes.patch index c555335a..37350661 100644 --- a/leaves-server/minecraft-patches/features/0108-Revert-raid-changes.patch +++ b/leaves-server/minecraft-patches/features/0108-Revert-raid-changes.patch @@ -20,6 +20,93 @@ index 80f17f33f670018240c854df589cf90cdeab6e70..4c6ce6a4a730033802651b0c0052fc46 Raid raidAt = level.getRaidAt(serverPlayer.blockPosition()); 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 41b0db439b425b052bd1469daa6620a435ca852b..4e2b73ad91b4fc12da123b22910a7e3a78b23d1d 100644 +--- a/net/minecraft/world/entity/raid/Raid.java ++++ b/net/minecraft/world/entity/raid/Raid.java +@@ -318,7 +318,20 @@ public class Raid { + } + + if (flag1) { +- this.waveSpawnPos = this.getValidSpawnPos(); ++ // Leaves Start - old FindSpawnPosition ++ if (!org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.useOldFindSpawnPosition) { ++ this.waveSpawnPos = this.getValidSpawnPos(); ++ } else { ++ int n4 = 0; ++ if (this.raidCooldownTicks < 100) { ++ n4 = 1; ++ } ++ if (this.raidCooldownTicks < 40) { ++ n4 = 2; ++ } ++ this.waveSpawnPos = this.getValidSpawnPos(n4); ++ } ++ // Leaves End - old FindSpawnPosition + } + + if (this.raidCooldownTicks == 300 || this.raidCooldownTicks % 20 == 0) { +@@ -353,7 +366,14 @@ public class Raid { + int i = 0; + + while (this.shouldSpawnGroup()) { +- BlockPos blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(20)); ++ // Leaves Start - old FindSpawnPosition ++ BlockPos blockPos; ++ if (!org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.useOldFindSpawnPosition) { ++ blockPos = this.waveSpawnPos.orElseGet(() -> this.findRandomSpawnPos(20)); ++ } else { ++ blockPos = this.waveSpawnPos.isPresent() ? this.waveSpawnPos.get() : this.findRandomSpawnPos(i, 20); ++ } ++ // Leaves End - old FindSpawnPosition + if (blockPos != null) { + this.started = true; + this.spawnGroup(blockPos); +@@ -365,7 +385,7 @@ public class Raid { + i++; + } + +- if (i > 5) { ++ if (i > (org.leavesmc.leaves.LeavesConfig.modify.oldMC.raid.useOldFindSpawnPosition ? 3 : 5)) { // Leaves - old FindSpawnPosition + org.bukkit.craftbukkit.event.CraftEventFactory.callRaidStopEvent(this, org.bukkit.event.raid.RaidStopEvent.Reason.UNSPAWNABLE); // CraftBukkit + this.stop(); + break; +@@ -680,6 +700,35 @@ public class Raid { + return null; + } + ++ // Leaves Start - old FindSpawnPosition ++ @Nullable ++ private BlockPos findRandomSpawnPos(int n, int n2) { ++ int n3 = 2 - n; ++ BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos(); ++ SpawnPlacementType spawnPlacementType = SpawnPlacements.getPlacementType(EntityType.RAVAGER); ++ for (int i = 0; i < n2; ++i) { ++ float f = this.level.random.nextFloat() * ((float)Math.PI * 2); ++ int n4 = this.center.getX() + Mth.floor(Mth.cos(f) * 32.0f * (float)n3) + this.level.random.nextInt(5); ++ int n5 = this.center.getZ() + Mth.floor(Mth.sin(f) * 32.0f * (float)n3) + this.level.random.nextInt(5); ++ int n6 = this.level.getHeight(Heightmap.Types.WORLD_SURFACE, n4, n5); ++ mutableBlockPos.set(n4, n6, n5); ++ if (this.level.isVillage(mutableBlockPos) && n < 2) continue; ++ if (!this.level.hasChunksAt(mutableBlockPos.getX() - 10, mutableBlockPos.getZ() - 10, mutableBlockPos.getX() + 10, mutableBlockPos.getZ() + 10) || !this.level.isPositionEntityTicking(mutableBlockPos) || !spawnPlacementType.isSpawnPositionOk(this.level, mutableBlockPos, EntityType.RAVAGER) && (!this.level.getBlockState((BlockPos)mutableBlockPos.below()).is(Blocks.SNOW) || !this.level.getBlockState(mutableBlockPos).isAir())) continue; ++ return mutableBlockPos; ++ } ++ return null; ++ } ++ ++ private Optional getValidSpawnPos(int n) { ++ for (int i = 0; i < 3; ++i) { ++ BlockPos blockPos = this.findRandomSpawnPos(n, 1); ++ if (blockPos == null) continue; ++ return Optional.of(blockPos); ++ } ++ return Optional.empty(); ++ } ++ // Leaves End - old FindSpawnPosition ++ + private boolean addWaveMob(int wave, Raider raider) { + return this.addWaveMob(wave, raider, true); + } diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java index f58a20e7dd6b8dc3fc431d4aba9f91a7c25f2c33..ce692698260d4751b13d5b26f7d9403c72b413c6 100644 --- a/net/minecraft/world/entity/raid/Raider.java diff --git a/leaves-server/minecraft-patches/features/0116-Skippable-raid-height-check.patch b/leaves-server/minecraft-patches/features/0116-Skippable-raid-height-check.patch index a10e3fb5..daeaa96c 100644 --- a/leaves-server/minecraft-patches/features/0116-Skippable-raid-height-check.patch +++ b/leaves-server/minecraft-patches/features/0116-Skippable-raid-height-check.patch @@ -5,10 +5,10 @@ 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 41b0db439b425b052bd1469daa6620a435ca852b..f14cdeb3d63b5b8e5bd0074aa245f1b5bd7ef0d3 100644 +index 9712dc3da64e5c5f653eef353c0247805ccca685..e24260e808b50ad0eb7e2d2e41d11e20d0067a69 100644 --- a/net/minecraft/world/entity/raid/Raid.java +++ b/net/minecraft/world/entity/raid/Raid.java -@@ -660,7 +660,7 @@ public class Raid { +@@ -680,7 +680,7 @@ public class Raid { int i2 = this.center.getX() + Mth.floor(Mth.cos(f2) * 32.0F * f) + this.level.random.nextInt(3) * Mth.floor(f); int i3 = this.center.getZ() + Mth.floor(Mth.sin(f2) * 32.0F * f) + this.level.random.nextInt(3) * Mth.floor(f); int height = this.level.getHeight(Heightmap.Types.WORLD_SURFACE, i2, i3); 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 a58635c3..66367762 100644 --- a/leaves-server/src/main/java/org/leavesmc/leaves/LeavesConfig.java +++ b/leaves-server/src/main/java/org/leavesmc/leaves/LeavesConfig.java @@ -293,6 +293,9 @@ public final class LeavesConfig { @GlobalConfig("give-bad-omen-when-kill-patrol-leader") public boolean giveBadOmenWhenKillPatrolLeader = false; + @GlobalConfig("use-old-find-spawn-position") + public boolean useOldFindSpawnPosition = false; + @GlobalConfig("skip-height-check") public boolean skipHeightCheck = false; }