From 2ff8e3c3a5f8d266c53807136e61740115d35f98 Mon Sep 17 00:00:00 2001 From: granny Date: Sun, 28 Apr 2024 01:42:40 -0700 Subject: [PATCH] 250... --- ...0198-Conduit-behavior-configuration.patch} | 69 ++-- .../0199-Cauldron-fill-chances.patch} | 10 +- ...o-allow-mobs-to-pathfind-over-rails.patch} | 16 +- .../0201-Shulker-change-color-with-dye.patch} | 8 +- .../0202-Extended-OfflinePlayer-API.patch} | 6 +- ...he-ability-to-add-combustible-items.patch} | 8 +- ...in-and-thunder-should-stop-on-sleep.patch} | 6 +- ...-blocks-to-grow-into-trees-naturall.patch} | 8 +- ...-right-click-to-use-exp-for-mending.patch} | 12 +- ...urally-aggressive-to-players-chance.patch} | 14 +- ...urally-aggressive-to-players-chance.patch} | 22 +- ...r-beds-to-explode-on-villager-sleep.patch} | 4 +- ...Halloween-options-and-optimizations.patch} | 22 +- .../0211-Config-for-grindstones.patch} | 47 +-- .../0212-UPnP-Port-Forwarding.patch} | 12 +- ...Campfire-option-for-lit-when-placed.patch} | 2 +- ...tinguish-fire-blocks-with-snowballs.patch} | 2 +- ...on-to-disable-zombie-villagers-cure.patch} | 10 +- ...nt-BlockEntity-Lore-and-DisplayName.patch} | 40 +-- .../0217-Signs-allow-color-codes.patch} | 22 +- ...-and-twisting-vines-configurable-ma.patch} | 14 +- .../0219-Mobs-always-drop-experience.patch} | 306 +++++++++--------- .../0220-Potion-NamespacedKey.patch} | 141 ++++---- .../0221-Grindstone-API.patch} | 4 +- ...e-to-replant-crops-and-nether-warts.patch} | 10 +- ...urtle-eggs-random-tick-crack-chance.patch} | 4 +- .../0224-Mob-head-visibility-percent.patch} | 4 +- ...able-valid-characters-for-usernames.patch} | 14 +- ...Shears-can-have-looting-enchantment.patch} | 82 +---- ...Stop-bees-from-dying-after-stinging.patch} | 4 +- ...ounts-in-beehives-to-Purpur-clients.patch} | 12 +- ...onfigurable-farmland-trample-height.patch} | 4 +- ...onfigurable-player-pickup-exp-delay.patch} | 8 +- .../0231-Allow-void-trading.patch} | 4 +- .../0232-Configurable-phantom-size.patch} | 8 +- .../0233-Max-joins-per-second.patch} | 6 +- ...figurable-minimum-demand-for-trades.patch} | 8 +- .../0235-Lobotomize-stuck-villagers.patch} | 21 +- ...ion-for-villager-display-trade-item.patch} | 0 ...wner-not-spawning-water-animals-cor.patch} | 4 +- ...ig-for-mob-last-hurt-by-player-time.patch} | 8 +- .../0239-Anvil-repair-damage-options.patch} | 6 +- ...-turtle-egg-trampling-with-feather-.patch} | 4 +- ...d-toggle-for-enchant-level-clamping.patch} | 30 +- ...kip-junit-tests-for-purpur-commands.patch} | 12 +- ...rable-search-radius-for-villagers-t.patch} | 4 +- .../0244-Stonecutter-damage.patch} | 47 ++- ...le-damage-settings-for-magma-blocks.patch} | 2 +- ...246-Add-config-for-snow-on-blue-ice.patch} | 4 +- 49 files changed, 509 insertions(+), 606 deletions(-) rename patches/{unapplied-server/0201-Conduit-behavior-configuration.patch => server/0198-Conduit-behavior-configuration.patch} (59%) rename patches/{unapplied-server/0202-Cauldron-fill-chances.patch => server/0199-Cauldron-fill-chances.patch} (91%) rename patches/{unapplied-server/0203-Config-to-allow-mobs-to-pathfind-over-rails.patch => server/0200-Config-to-allow-mobs-to-pathfind-over-rails.patch} (76%) rename patches/{unapplied-server/0204-Shulker-change-color-with-dye.patch => server/0201-Shulker-change-color-with-dye.patch} (93%) rename patches/{unapplied-server/0205-Extended-OfflinePlayer-API.patch => server/0202-Extended-OfflinePlayer-API.patch} (97%) rename patches/{unapplied-server/0206-Added-the-ability-to-add-combustible-items.patch => server/0203-Added-the-ability-to-add-combustible-items.patch} (92%) rename patches/{unapplied-server/0207-Option-for-if-rain-and-thunder-should-stop-on-sleep.patch => server/0204-Option-for-if-rain-and-thunder-should-stop-on-sleep.patch} (93%) rename patches/{unapplied-server/0208-Chance-for-azalea-blocks-to-grow-into-trees-naturall.patch => server/0205-Chance-for-azalea-blocks-to-grow-into-trees-naturall.patch} (93%) rename patches/{unapplied-server/0209-Shift-right-click-to-use-exp-for-mending.patch => server/0206-Shift-right-click-to-use-exp-for-mending.patch} (90%) rename patches/{unapplied-server/0210-Dolphins-naturally-aggressive-to-players-chance.patch => server/0207-Dolphins-naturally-aggressive-to-players-chance.patch} (91%) rename patches/{unapplied-server/0211-Cows-naturally-aggressive-to-players-chance.patch => server/0208-Cows-naturally-aggressive-to-players-chance.patch} (87%) rename patches/{unapplied-server/0212-Option-for-beds-to-explode-on-villager-sleep.patch => server/0209-Option-for-beds-to-explode-on-villager-sleep.patch} (94%) rename patches/{unapplied-server/0213-Halloween-options-and-optimizations.patch => server/0210-Halloween-options-and-optimizations.patch} (85%) rename patches/{unapplied-server/0214-Config-for-grindstones.patch => server/0211-Config-for-grindstones.patch} (66%) rename patches/{unapplied-server/0215-UPnP-Port-Forwarding.patch => server/0212-UPnP-Port-Forwarding.patch} (89%) rename patches/{unapplied-server/0216-Campfire-option-for-lit-when-placed.patch => server/0213-Campfire-option-for-lit-when-placed.patch} (96%) rename patches/{unapplied-server/0217-options-to-extinguish-fire-blocks-with-snowballs.patch => server/0214-options-to-extinguish-fire-blocks-with-snowballs.patch} (98%) rename patches/{unapplied-server/0218-Add-option-to-disable-zombie-villagers-cure.patch => server/0215-Add-option-to-disable-zombie-villagers-cure.patch} (82%) rename patches/{unapplied-server/0219-Persistent-BlockEntity-Lore-and-DisplayName.patch => server/0216-Persistent-BlockEntity-Lore-and-DisplayName.patch} (89%) rename patches/{unapplied-server/0220-Signs-allow-color-codes.patch => server/0217-Signs-allow-color-codes.patch} (84%) rename patches/{unapplied-server/0221-Kelp-cave-weeping-and-twisting-vines-configurable-ma.patch => server/0218-Kelp-cave-weeping-and-twisting-vines-configurable-ma.patch} (94%) rename patches/{unapplied-server/0222-Mobs-always-drop-experience.patch => server/0219-Mobs-always-drop-experience.patch} (91%) rename patches/{unapplied-server/0223-Potion-NamespacedKey.patch => server/0220-Potion-NamespacedKey.patch} (58%) rename patches/{unapplied-server/0224-Grindstone-API.patch => server/0221-Grindstone-API.patch} (92%) rename patches/{unapplied-server/0225-Ability-for-hoe-to-replant-crops-and-nether-warts.patch => server/0222-Ability-for-hoe-to-replant-crops-and-nether-warts.patch} (92%) rename patches/{unapplied-server/0226-Turtle-eggs-random-tick-crack-chance.patch => server/0223-Turtle-eggs-random-tick-crack-chance.patch} (93%) rename patches/{unapplied-server/0227-Mob-head-visibility-percent.patch => server/0224-Mob-head-visibility-percent.patch} (97%) rename patches/{unapplied-server/0228-Configurable-valid-characters-for-usernames.patch => server/0225-Configurable-valid-characters-for-usernames.patch} (69%) rename patches/{unapplied-server/0229-Shears-can-have-looting-enchantment.patch => server/0226-Shears-can-have-looting-enchantment.patch} (67%) rename patches/{unapplied-server/0230-Stop-bees-from-dying-after-stinging.patch => server/0227-Stop-bees-from-dying-after-stinging.patch} (92%) rename patches/{unapplied-server/0231-Give-bee-counts-in-beehives-to-Purpur-clients.patch => server/0228-Give-bee-counts-in-beehives-to-Purpur-clients.patch} (92%) rename patches/{unapplied-server/0232-Configurable-farmland-trample-height.patch => server/0229-Configurable-farmland-trample-height.patch} (95%) rename patches/{unapplied-server/0233-Configurable-player-pickup-exp-delay.patch => server/0230-Configurable-player-pickup-exp-delay.patch} (92%) rename patches/{unapplied-server/0234-Allow-void-trading.patch => server/0231-Allow-void-trading.patch} (94%) rename patches/{unapplied-server/0235-Configurable-phantom-size.patch => server/0232-Configurable-phantom-size.patch} (91%) rename patches/{unapplied-server/0237-Max-joins-per-second.patch => server/0233-Max-joins-per-second.patch} (90%) rename patches/{unapplied-server/0238-Configurable-minimum-demand-for-trades.patch => server/0234-Configurable-minimum-demand-for-trades.patch} (91%) rename patches/{unapplied-server/0239-Lobotomize-stuck-villagers.patch => server/0235-Lobotomize-stuck-villagers.patch} (91%) rename patches/{unapplied-server/0240-Option-for-villager-display-trade-item.patch => server/0236-Option-for-villager-display-trade-item.patch} (100%) rename patches/{unapplied-server/0241-MC-238526-Fix-spawner-not-spawning-water-animals-cor.patch => server/0237-MC-238526-Fix-spawner-not-spawning-water-animals-cor.patch} (92%) rename patches/{unapplied-server/0242-Config-for-mob-last-hurt-by-player-time.patch => server/0238-Config-for-mob-last-hurt-by-player-time.patch} (92%) rename patches/{unapplied-server/0243-Anvil-repair-damage-options.patch => server/0239-Anvil-repair-damage-options.patch} (94%) rename patches/{unapplied-server/0244-Option-to-disable-turtle-egg-trampling-with-feather-.patch => server/0240-Option-to-disable-turtle-egg-trampling-with-feather-.patch} (94%) rename patches/{unapplied-server/0245-Add-toggle-for-enchant-level-clamping.patch => server/0241-Add-toggle-for-enchant-level-clamping.patch} (65%) rename patches/{unapplied-server/0246-Skip-junit-tests-for-purpur-commands.patch => server/0242-Skip-junit-tests-for-purpur-commands.patch} (80%) rename patches/{unapplied-server/0247-Implement-configurable-search-radius-for-villagers-t.patch => server/0243-Implement-configurable-search-radius-for-villagers-t.patch} (94%) rename patches/{unapplied-server/0248-Stonecutter-damage.patch => server/0244-Stonecutter-damage.patch} (80%) rename patches/{unapplied-server/0249-Configurable-damage-settings-for-magma-blocks.patch => server/0245-Configurable-damage-settings-for-magma-blocks.patch} (96%) rename patches/{unapplied-server/0250-Add-config-for-snow-on-blue-ice.patch => server/0246-Add-config-for-snow-on-blue-ice.patch} (91%) diff --git a/patches/unapplied-server/0201-Conduit-behavior-configuration.patch b/patches/server/0198-Conduit-behavior-configuration.patch similarity index 59% rename from patches/unapplied-server/0201-Conduit-behavior-configuration.patch rename to patches/server/0198-Conduit-behavior-configuration.patch index ed8f999de..353d1f743 100644 --- a/patches/unapplied-server/0201-Conduit-behavior-configuration.patch +++ b/patches/server/0198-Conduit-behavior-configuration.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Conduit behavior configuration diff --git a/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java -index 37e0b762b86e74f607a4541ecb7b24ad7a591d0e..7e3edd41f3a39ef14382e18b20af21e63ce0677b 100644 +index 73e532dc998e5701c1a73da846da3d3a79871b81..da36058e52330aaf483d506f3d26ff345d1b8b0c 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/ConduitBlockEntity.java -@@ -167,7 +167,7 @@ public class ConduitBlockEntity extends BlockEntity { +@@ -168,7 +168,7 @@ public class ConduitBlockEntity extends BlockEntity { if ((l > 1 || i1 > 1 || j1 > 1) && (i == 0 && (i1 == 2 || j1 == 2) || j == 0 && (l == 2 || j1 == 2) || k == 0 && (l == 2 || i1 == 2))) { BlockPos blockposition2 = pos.offset(i, j, k); BlockState iblockdata = world.getBlockState(blockposition2); @@ -17,43 +17,43 @@ index 37e0b762b86e74f607a4541ecb7b24ad7a591d0e..7e3edd41f3a39ef14382e18b20af21e6 int k1 = ablock.length; for (int l1 = 0; l1 < k1; ++l1) { -@@ -187,7 +187,7 @@ public class ConduitBlockEntity extends BlockEntity { - - private static void applyEffects(Level world, BlockPos pos, List activatingBlocks) { - int i = activatingBlocks.size(); -- int j = i / 7 * 16; // Paper - Conduit API; diff on change -+ int j = i / 7 * world.purpurConfig.conduitDistance; // Paper - Conduit API; diff on change // Purpur - int k = pos.getX(); - int l = pos.getY(); - int i1 = pos.getZ(); -@@ -218,20 +218,20 @@ public class ConduitBlockEntity extends BlockEntity { - blockEntity.destroyTarget = ConduitBlockEntity.findDestroyTarget(world, pos, blockEntity.destroyTargetUUID); - blockEntity.destroyTargetUUID = null; - } else if (blockEntity.destroyTarget == null) { -- List list1 = world.getEntitiesOfClass(LivingEntity.class, ConduitBlockEntity.getDestroyRangeAABB(pos), (entityliving1) -> { -+ List list1 = world.getEntitiesOfClass(LivingEntity.class, ConduitBlockEntity.getDestroyRangeAABB(pos, world), (entityliving1) -> { // Purpur +@@ -194,7 +194,7 @@ public class ConduitBlockEntity extends BlockEntity { + public static int getRange(List list) { + // CraftBukkit end + int i = list.size(); +- int j = i / 7 * 16; ++ int j = i / 7 * world.purpurConfig.conduitDistance; // Purpur + // CraftBukkit start + return j; + } +@@ -237,20 +237,20 @@ public class ConduitBlockEntity extends BlockEntity { + tileentityconduit.destroyTarget = ConduitBlockEntity.findDestroyTarget(world, blockposition, tileentityconduit.destroyTargetUUID); + tileentityconduit.destroyTargetUUID = null; + } else if (tileentityconduit.destroyTarget == null) { +- List list1 = world.getEntitiesOfClass(LivingEntity.class, ConduitBlockEntity.getDestroyRangeAABB(blockposition), (entityliving1) -> { ++ List list1 = world.getEntitiesOfClass(LivingEntity.class, ConduitBlockEntity.getDestroyRangeAABB(blockposition, world), (entityliving1) -> { // Purpur return entityliving1 instanceof Enemy && entityliving1.isInWaterOrRain(); }); if (!list1.isEmpty()) { - blockEntity.destroyTarget = (LivingEntity) list1.get(world.random.nextInt(list1.size())); + tileentityconduit.destroyTarget = (LivingEntity) list1.get(world.random.nextInt(list1.size())); } -- } else if (!blockEntity.destroyTarget.isAlive() || !pos.closerThan(blockEntity.destroyTarget.blockPosition(), 8.0D)) { -+ } else if (!blockEntity.destroyTarget.isAlive() || !pos.closerThan(blockEntity.destroyTarget.blockPosition(), world.purpurConfig.conduitDamageDistance)) { // Purpur - blockEntity.destroyTarget = null; +- } else if (!tileentityconduit.destroyTarget.isAlive() || !blockposition.closerThan(tileentityconduit.destroyTarget.blockPosition(), 8.0D)) { ++ } else if (!tileentityconduit.destroyTarget.isAlive() || !blockposition.closerThan(tileentityconduit.destroyTarget.blockPosition(), world.purpurConfig.conduitDamageDistance)) { // Purpur + tileentityconduit.destroyTarget = null; } - if (blockEntity.destroyTarget != null) { - // CraftBukkit start -- if (blockEntity.destroyTarget.hurt(world.damageSources().magic().directBlock(world, pos), 4.0F)) { // CraftBukkit -+ if (blockEntity.destroyTarget.hurt(world.damageSources().magic().directBlock(world, pos), world.purpurConfig.conduitDamageAmount)) { // CraftBukkit // Purpur - world.playSound(null, blockEntity.destroyTarget.getX(), blockEntity.destroyTarget.getY(), blockEntity.destroyTarget.getZ(), SoundEvents.CONDUIT_ATTACK_TARGET, SoundSource.BLOCKS, 1.0F, 1.0F); + // CraftBukkit start + if (damageTarget && tileentityconduit.destroyTarget != null) { +- if (tileentityconduit.destroyTarget.hurt(world.damageSources().magic().directBlock(world, blockposition), 4.0F)) { ++ if (tileentityconduit.destroyTarget.hurt(world.damageSources().magic().directBlock(world, blockposition), world.purpurConfig.conduitDamageAmount)) { // Purpur + world.playSound(null, tileentityconduit.destroyTarget.getX(), tileentityconduit.destroyTarget.getY(), tileentityconduit.destroyTarget.getZ(), SoundEvents.CONDUIT_ATTACK_TARGET, SoundSource.BLOCKS, 1.0F, 1.0F); } // CraftBukkit end -@@ -256,16 +256,22 @@ public class ConduitBlockEntity extends BlockEntity { +@@ -275,16 +275,22 @@ public class ConduitBlockEntity extends BlockEntity { } - private static AABB getDestroyRangeAABB(BlockPos pos) { + public static AABB getDestroyRangeAABB(BlockPos pos) { + // Purpur start + return getDestroyRangeAABB(pos, null); + } @@ -75,19 +75,6 @@ index 37e0b762b86e74f607a4541ecb7b24ad7a591d0e..7e3edd41f3a39ef14382e18b20af21e6 return entityliving.getUUID().equals(uuid); }); -diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java b/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java -index f0b0348e105fb27c829ec29e638433c57bfd5f64..57ce4b7c5fcfe7a88928cd4124f29af39e117ed9 100644 ---- a/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java -+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java -@@ -29,7 +29,7 @@ public class CraftConduit extends CraftBlockEntityState impl - @Override - public int getRange() { - requirePlaced(); -- return this.getTileEntity().effectBlocks.size() / 7 * 16; -+ return this.getTileEntity().effectBlocks.size() / 7 * this.world.getHandle().purpurConfig.conduitDistance; // Purpur - } - - @Override diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java index 6cb425d017cc8b12aece5bc1982d85056fc58431..60b511bd94288badd8b6390b5f66d5c79478a71b 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java diff --git a/patches/unapplied-server/0202-Cauldron-fill-chances.patch b/patches/server/0199-Cauldron-fill-chances.patch similarity index 91% rename from patches/unapplied-server/0202-Cauldron-fill-chances.patch rename to patches/server/0199-Cauldron-fill-chances.patch index fe77c21e1..e3647b741 100644 --- a/patches/unapplied-server/0202-Cauldron-fill-chances.patch +++ b/patches/server/0199-Cauldron-fill-chances.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Cauldron fill chances diff --git a/src/main/java/net/minecraft/world/level/block/CauldronBlock.java b/src/main/java/net/minecraft/world/level/block/CauldronBlock.java -index 47b6b83842201620bd6620f5acf11bb14334e35d..b4d2499ae39fd3f14b2600a9663ea8a823bdfbe4 100644 +index c9968934f4ecaa8d81e545f279b3001c7b1ce545..03e4fce6f8226451365fc2831b5bf1e5e6091730 100644 --- a/src/main/java/net/minecraft/world/level/block/CauldronBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CauldronBlock.java -@@ -36,7 +36,7 @@ public class CauldronBlock extends AbstractCauldronBlock { +@@ -37,7 +37,7 @@ public class CauldronBlock extends AbstractCauldronBlock { } protected static boolean shouldHandlePrecipitation(Level world, Biome.Precipitation precipitation) { @@ -18,10 +18,10 @@ index 47b6b83842201620bd6620f5acf11bb14334e35d..b4d2499ae39fd3f14b2600a9663ea8a8 @Override diff --git a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java -index 5835872df922b859a31b44e3723c67097f21a641..ecb595ddf21b593175c27d59fd9587e7f2d56517 100644 +index a2bd54dae4b0460d200f6d5300194a7ef5a28830..bf189a171530abfc9bba5db5a305feb391f2cbee 100644 --- a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java +++ b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java -@@ -189,7 +189,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate +@@ -190,7 +190,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate @VisibleForTesting public static void maybeTransferFluid(BlockState state, ServerLevel world, BlockPos pos, float dripChance) { @@ -30,7 +30,7 @@ index 5835872df922b859a31b44e3723c67097f21a641..ecb595ddf21b593175c27d59fd9587e7 if (PointedDripstoneBlock.isStalactiteStartPos(state, world, pos)) { Optional optional = PointedDripstoneBlock.getFluidAboveStalactite(world, pos, state); -@@ -198,13 +198,13 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate +@@ -199,13 +199,13 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate float f1; if (fluidtype == Fluids.WATER) { diff --git a/patches/unapplied-server/0203-Config-to-allow-mobs-to-pathfind-over-rails.patch b/patches/server/0200-Config-to-allow-mobs-to-pathfind-over-rails.patch similarity index 76% rename from patches/unapplied-server/0203-Config-to-allow-mobs-to-pathfind-over-rails.patch rename to patches/server/0200-Config-to-allow-mobs-to-pathfind-over-rails.patch index d1b5f2afd..4f2583613 100644 --- a/patches/unapplied-server/0203-Config-to-allow-mobs-to-pathfind-over-rails.patch +++ b/patches/server/0200-Config-to-allow-mobs-to-pathfind-over-rails.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Config to allow mobs to pathfind over rails diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java -index 7e62873eea85e33f81c943e70292ccb71a3dd276..b7f9793900d365f91d6e30dd22881a30e4250ac8 100644 +index d5004290e40a1ff5e0fcfe75f8da34ae15962359..31ae0f466ae522d767907ec5066b26695f327b96 100644 --- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java -@@ -259,7 +259,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { +@@ -240,7 +240,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { if ((node == null || node.costMalus < 0.0F) && maxYStep > 0 - && (blockPathTypes != BlockPathTypes.FENCE || this.canWalkOverFences()) -- && blockPathTypes != BlockPathTypes.UNPASSABLE_RAIL -+ && (this.mob.level().purpurConfig.mobsIgnoreRails || blockPathTypes != BlockPathTypes.UNPASSABLE_RAIL) // Purpur - && blockPathTypes != BlockPathTypes.TRAPDOOR - && blockPathTypes != BlockPathTypes.POWDER_SNOW) { - node = this.findAcceptedNode(x, y + 1, z, maxYStep - 1, prevFeetY, direction, nodeType); + && (pathType != PathType.FENCE || this.canWalkOverFences()) +- && pathType != PathType.UNPASSABLE_RAIL ++ && (this.mob.level().purpurConfig.mobsIgnoreRails || pathType != PathType.UNPASSABLE_RAIL) // Purpur + && pathType != PathType.TRAPDOOR + && pathType != PathType.POWDER_SNOW) { + node = this.tryJumpOn(x, y, z, maxYStep, prevFeetY, direction, nodeType, mutableBlockPos); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java index 0893e133393e35a6b0a66c09cb800265426ec427..7f0b09f7e7e1f294bd7d4b384c587789dd8ffb12 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java diff --git a/patches/unapplied-server/0204-Shulker-change-color-with-dye.patch b/patches/server/0201-Shulker-change-color-with-dye.patch similarity index 93% rename from patches/unapplied-server/0204-Shulker-change-color-with-dye.patch rename to patches/server/0201-Shulker-change-color-with-dye.patch index 7e0daecea..9c350a2ee 100644 --- a/patches/unapplied-server/0204-Shulker-change-color-with-dye.patch +++ b/patches/server/0201-Shulker-change-color-with-dye.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Shulker change color with dye diff --git a/src/main/java/net/minecraft/world/entity/monster/Shulker.java b/src/main/java/net/minecraft/world/entity/monster/Shulker.java -index df944e733ca589d407af3709e0ff025f568600b7..25b9f131f9d0fdb0a53ddcc685d8ae250cb3abd6 100644 +index 73063abbd051f1d044a8b2c0530cc8d2a96a6331..687fadf1ef64c5ae7e00c5da15b82245e07d3a39 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Shulker.java +++ b/src/main/java/net/minecraft/world/entity/monster/Shulker.java -@@ -22,6 +22,8 @@ import net.minecraft.tags.DamageTypeTags; +@@ -23,6 +23,8 @@ import net.minecraft.tags.DamageTypeTags; import net.minecraft.util.Mth; import net.minecraft.world.Difficulty; import net.minecraft.world.DifficultyInstance; @@ -16,8 +16,8 @@ index df944e733ca589d407af3709e0ff025f568600b7..25b9f131f9d0fdb0a53ddcc685d8ae25 +import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; - import net.minecraft.world.entity.EntityDimensions; -@@ -49,6 +51,8 @@ import net.minecraft.world.entity.player.Player; + import net.minecraft.world.entity.EntitySelector; +@@ -48,6 +50,8 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.projectile.AbstractArrow; import net.minecraft.world.entity.projectile.ShulkerBullet; import net.minecraft.world.item.DyeColor; diff --git a/patches/unapplied-server/0205-Extended-OfflinePlayer-API.patch b/patches/server/0202-Extended-OfflinePlayer-API.patch similarity index 97% rename from patches/unapplied-server/0205-Extended-OfflinePlayer-API.patch rename to patches/server/0202-Extended-OfflinePlayer-API.patch index 1f61bcad4..43aa6d94a 100644 --- a/patches/unapplied-server/0205-Extended-OfflinePlayer-API.patch +++ b/patches/server/0202-Extended-OfflinePlayer-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Extended OfflinePlayer API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java -index 4a875bce9563f3b9351ebecde9b0eb1287beb50e..42d83cfd9318d6ebe9a5392edef3b667c9e4dac0 100644 +index 9d93130f23addb18b97d7f5ec013faef17a74529..29d2fb87a65778926aea2cfc7a5b486cad596515 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -335,14 +335,26 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa @@ -243,10 +243,10 @@ index 4a875bce9563f3b9351ebecde9b0eb1287beb50e..42d83cfd9318d6ebe9a5392edef3b667 + // Purpur end - OfflinePlayer API } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 4e999cec1a004529a4bcd2f0ae63b3731bcac8f2..4a04c56371a2d9772fb542ffac5b9b98cbf1e86a 100644 +index 485c742874defe0a8cf1e7db09406b03ec40871b..0b278aaf675693e4babac5d551087285b59f8f5c 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2670,6 +2670,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2736,6 +2736,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return this.getHandle().getAbilities().walkingSpeed * 2f; } diff --git a/patches/unapplied-server/0206-Added-the-ability-to-add-combustible-items.patch b/patches/server/0203-Added-the-ability-to-add-combustible-items.patch similarity index 92% rename from patches/unapplied-server/0206-Added-the-ability-to-add-combustible-items.patch rename to patches/server/0203-Added-the-ability-to-add-combustible-items.patch index b2516f823..f5457d97f 100644 --- a/patches/unapplied-server/0206-Added-the-ability-to-add-combustible-items.patch +++ b/patches/server/0203-Added-the-ability-to-add-combustible-items.patch @@ -24,11 +24,11 @@ index 1af7e1548f0648890a1ef2fc0ff4e4c3a56c947c..decea1697c075e7549ccc7501c8e5935 } else if (this.isFuel(itemstack1)) { if (!this.moveItemStackTo(itemstack1, 1, 2, false)) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index c5bbb83f54d942d438ce8cf3a060ef2184069b88..5a3a619c4b936a4d186c0593f5af7b2493b85825 100644 +index ce2c424068001eec16032361baa206f6a5aa5332..72f4c1bbdfbb3e0710af33cee419b4ce8b023102 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -209,6 +209,22 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit - // Paper end - cache burn durations +@@ -214,6 +214,22 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit + } } + // Purpur start @@ -51,7 +51,7 @@ index c5bbb83f54d942d438ce8cf3a060ef2184069b88..5a3a619c4b936a4d186c0593f5af7b24 private int maxStack = MAX_STACK; public List transaction = new java.util.ArrayList(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a6affd4d7ecbe57a79fa18f4473c60662053d663..14e60675d23f9696fd8f64eb026fcd0b82b498f0 100644 +index 6a61d03ca1e88f4d8fe66bfa6c29e1550b88a103..b113e54cbe8262b7d0d8bae156d00baf04486b32 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1589,6 +1589,19 @@ public final class CraftServer implements Server { diff --git a/patches/unapplied-server/0207-Option-for-if-rain-and-thunder-should-stop-on-sleep.patch b/patches/server/0204-Option-for-if-rain-and-thunder-should-stop-on-sleep.patch similarity index 93% rename from patches/unapplied-server/0207-Option-for-if-rain-and-thunder-should-stop-on-sleep.patch rename to patches/server/0204-Option-for-if-rain-and-thunder-should-stop-on-sleep.patch index a0072961c..c9989a31b 100644 --- a/patches/unapplied-server/0207-Option-for-if-rain-and-thunder-should-stop-on-sleep.patch +++ b/patches/server/0204-Option-for-if-rain-and-thunder-should-stop-on-sleep.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Option for if rain and thunder should stop on sleep diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 4a08c804c3e31a80ee9b663a44fd60142709c9c6..39a6ff48d820b56728398ac287f9a4db108f3bad 100644 +index 83ec2e31d81d6209953252a3780552c3cf110c68..42db3e64b120b753e98a0fd7e3f56c7d28256fd2 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -1401,6 +1401,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1391,6 +1391,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @VisibleForTesting public void resetWeatherCycle() { // CraftBukkit start @@ -16,7 +16,7 @@ index 4a08c804c3e31a80ee9b663a44fd60142709c9c6..39a6ff48d820b56728398ac287f9a4db this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents // If we stop due to everyone sleeping we should reset the weather duration to some other random value. // Not that everyone ever manages to get the whole server to sleep at the same time.... -@@ -1408,6 +1409,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -1398,6 +1399,7 @@ public class ServerLevel extends Level implements WorldGenLevel { this.serverLevelData.setRainTime(0); } // CraftBukkit end diff --git a/patches/unapplied-server/0208-Chance-for-azalea-blocks-to-grow-into-trees-naturall.patch b/patches/server/0205-Chance-for-azalea-blocks-to-grow-into-trees-naturall.patch similarity index 93% rename from patches/unapplied-server/0208-Chance-for-azalea-blocks-to-grow-into-trees-naturall.patch rename to patches/server/0205-Chance-for-azalea-blocks-to-grow-into-trees-naturall.patch index d4aac716f..7bb4a3c7d 100644 --- a/patches/unapplied-server/0208-Chance-for-azalea-blocks-to-grow-into-trees-naturall.patch +++ b/patches/server/0205-Chance-for-azalea-blocks-to-grow-into-trees-naturall.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Chance for azalea blocks to grow into trees naturally diff --git a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java -index c4d05b061a206df197996fdd0c29e2a4f8820bd1..08e32ae2fc4b02c526bf49617a8010c1bf2f2d95 100644 +index fad69dfc20574ab23634b14252b50929cca75b21..7082486f6b760bed2a61938f493d5124722b58e2 100644 --- a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java +++ b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java @@ -49,6 +49,20 @@ public class AzaleaBlock extends BushBlock implements BonemealableBlock { @@ -30,10 +30,10 @@ index c4d05b061a206df197996fdd0c29e2a4f8820bd1..08e32ae2fc4b02c526bf49617a8010c1 } diff --git a/src/main/java/net/minecraft/world/level/block/Blocks.java b/src/main/java/net/minecraft/world/level/block/Blocks.java -index e7c8313cafc25858ac002e3c45e63db9e8cefee9..04eace0873f1133ccca9696282948dc7ebc6f398 100644 +index 260906f493416d98ab574a7262fce5e9b7e40c64..ce639e4a2d87202a10ef4fc73274c4b2c4e95720 100644 --- a/src/main/java/net/minecraft/world/level/block/Blocks.java +++ b/src/main/java/net/minecraft/world/level/block/Blocks.java -@@ -7380,6 +7380,7 @@ public class Blocks { +@@ -7389,6 +7389,7 @@ public class Blocks { BlockBehaviour.Properties.of() .mapColor(MapColor.PLANT) .forceSolidOff() @@ -41,7 +41,7 @@ index e7c8313cafc25858ac002e3c45e63db9e8cefee9..04eace0873f1133ccca9696282948dc7 .instabreak() .sound(SoundType.AZALEA) .noOcclusion() -@@ -7392,6 +7393,7 @@ public class Blocks { +@@ -7401,6 +7402,7 @@ public class Blocks { BlockBehaviour.Properties.of() .mapColor(MapColor.PLANT) .forceSolidOff() diff --git a/patches/unapplied-server/0209-Shift-right-click-to-use-exp-for-mending.patch b/patches/server/0206-Shift-right-click-to-use-exp-for-mending.patch similarity index 90% rename from patches/unapplied-server/0209-Shift-right-click-to-use-exp-for-mending.patch rename to patches/server/0206-Shift-right-click-to-use-exp-for-mending.patch index b2e254f30..e2596f502 100644 --- a/patches/unapplied-server/0209-Shift-right-click-to-use-exp-for-mending.patch +++ b/patches/server/0206-Shift-right-click-to-use-exp-for-mending.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Shift right click to use exp for mending diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -index 1aa98f8ff062a906035c62875c454aeb0bc6f179..f8edb6b0d119582cf404b9931adc09484465fc9d 100644 +index a810eaa7dc319f5ea69b239190ae91838bfad4ec..6d194797d8fe2cd6e5652d596f4bc66ffc3b6375 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java -@@ -517,6 +517,7 @@ public class ServerPlayerGameMode { +@@ -513,6 +513,7 @@ public class ServerPlayerGameMode { public InteractionHand interactHand; public ItemStack interactItemStack; public InteractionResult useItemOn(ServerPlayer player, Level world, ItemStack stack, InteractionHand hand, BlockHitResult hitResult) { + if (shiftClickMended(stack)) return InteractionResult.SUCCESS; // Purpur BlockPos blockposition = hitResult.getBlockPos(); BlockState iblockdata = world.getBlockState(blockposition); - InteractionResult enuminteractionresult = InteractionResult.PASS; -@@ -619,4 +620,18 @@ public class ServerPlayerGameMode { + boolean cancelledBlock = false; +@@ -622,4 +623,18 @@ public class ServerPlayerGameMode { public void setLevel(ServerLevel world) { this.level = world; } @@ -36,10 +36,10 @@ index 1aa98f8ff062a906035c62875c454aeb0bc6f179..f8edb6b0d119582cf404b9931adc0948 + // Purpur end } diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index ccd830286153405206110334cf58323315c02b7e..1cefa3b6bdd62ae7bf30da872012fc150905f5ae 100644 +index fea36f5e4f64281459d62f4a6a4a7dd129706150..7c96644ee70ea061a5eb29809c2c5cc1bf55e194 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -@@ -2051,6 +2051,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl +@@ -2034,6 +2034,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl boolean cancelled; if (movingobjectposition == null || movingobjectposition.getType() != HitResult.Type.BLOCK) { diff --git a/patches/unapplied-server/0210-Dolphins-naturally-aggressive-to-players-chance.patch b/patches/server/0207-Dolphins-naturally-aggressive-to-players-chance.patch similarity index 91% rename from patches/unapplied-server/0210-Dolphins-naturally-aggressive-to-players-chance.patch rename to patches/server/0207-Dolphins-naturally-aggressive-to-players-chance.patch index 869d163f6..1b217e7a7 100644 --- a/patches/unapplied-server/0210-Dolphins-naturally-aggressive-to-players-chance.patch +++ b/patches/server/0207-Dolphins-naturally-aggressive-to-players-chance.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Dolphins naturally aggressive to players chance diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java -index 21e804d391478c613f4f89076fd268a9eb2e2ecf..9c35059d390c94f6d641c0fe8d37777fcf1b29f3 100644 +index 38112239035b0c66c429c0762199867e70e0a67a..e539eefb6e6d3172611d1f9185a1138001481885 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java +++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java -@@ -83,6 +83,7 @@ public class Dolphin extends WaterAnimal { +@@ -81,6 +81,7 @@ public class Dolphin extends WaterAnimal { public static final Predicate ALLOWED_ITEMS = (entityitem) -> { return !entityitem.hasPickUpDelay() && entityitem.isAlive() && entityitem.isInWater(); }; @@ -16,15 +16,15 @@ index 21e804d391478c613f4f89076fd268a9eb2e2ecf..9c35059d390c94f6d641c0fe8d37777f private int spitCooldown; // Purpur public Dolphin(EntityType type, Level world) { -@@ -174,6 +175,7 @@ public class Dolphin extends WaterAnimal { - public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) { +@@ -172,6 +173,7 @@ public class Dolphin extends WaterAnimal { + public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData) { this.setAirSupply(this.getMaxAirSupply()); this.setXRot(0.0F); + this.isNaturallyAggressiveToPlayers = world.getLevel().purpurConfig.dolphinNaturallyAggressiveToPlayersChance > 0.0D && random.nextDouble() <= world.getLevel().purpurConfig.dolphinNaturallyAggressiveToPlayersChance; // Purpur - return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt); + return super.finalizeSpawn(world, difficulty, spawnReason, entityData); } -@@ -238,6 +240,7 @@ public class Dolphin extends WaterAnimal { +@@ -236,6 +238,7 @@ public class Dolphin extends WaterAnimal { protected void registerGoals() { this.goalSelector.addGoal(0, new BreathAirGoal(this)); this.goalSelector.addGoal(0, new TryFindWaterGoal(this)); @@ -32,7 +32,7 @@ index 21e804d391478c613f4f89076fd268a9eb2e2ecf..9c35059d390c94f6d641c0fe8d37777f this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur this.goalSelector.addGoal(1, new Dolphin.DolphinSwimToTreasureGoal(this)); this.goalSelector.addGoal(2, new Dolphin.DolphinSwimWithPlayerGoal(this, 4.0D)); -@@ -245,12 +248,13 @@ public class Dolphin extends WaterAnimal { +@@ -243,12 +246,13 @@ public class Dolphin extends WaterAnimal { this.goalSelector.addGoal(4, new RandomLookAroundGoal(this)); this.goalSelector.addGoal(5, new LookAtPlayerGoal(this, Player.class, 6.0F)); this.goalSelector.addGoal(5, new DolphinJumpGoal(this, 10)); diff --git a/patches/unapplied-server/0211-Cows-naturally-aggressive-to-players-chance.patch b/patches/server/0208-Cows-naturally-aggressive-to-players-chance.patch similarity index 87% rename from patches/unapplied-server/0211-Cows-naturally-aggressive-to-players-chance.patch rename to patches/server/0208-Cows-naturally-aggressive-to-players-chance.patch index e525cedf5..7f975656f 100644 --- a/patches/unapplied-server/0211-Cows-naturally-aggressive-to-players-chance.patch +++ b/patches/server/0208-Cows-naturally-aggressive-to-players-chance.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Cows naturally aggressive to players chance diff --git a/src/main/java/net/minecraft/world/entity/animal/Cow.java b/src/main/java/net/minecraft/world/entity/animal/Cow.java -index 4c2cc5ba3c8f15c26f01361e786d25b399747974..da3dfa10e08750e7ad84ff32a0c0136e055ee3a7 100644 +index 8c908891c6c683332d8877ab3fa084a0849b17a9..106d2d692e2393517793c2bac8bebf401f717bea 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cow.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cow.java -@@ -42,6 +42,7 @@ import org.bukkit.event.player.PlayerBucketFillEvent; +@@ -39,6 +39,7 @@ import org.bukkit.event.player.PlayerBucketFillEvent; // CraftBukkit end public class Cow extends Animal { + private boolean isNaturallyAggressiveToPlayers; // Purpur - public Cow(EntityType type, Level world) { - super(type, world); -@@ -67,6 +68,7 @@ public class Cow extends Animal { + private static final EntityDimensions BABY_DIMENSIONS = EntityType.COW.getDimensions().scale(0.5F).withEyeHeight(0.665F); + +@@ -66,6 +67,7 @@ public class Cow extends Animal { @Override public void initAttributes() { this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.cowMaxHealth); @@ -24,7 +24,7 @@ index 4c2cc5ba3c8f15c26f01361e786d25b399747974..da3dfa10e08750e7ad84ff32a0c0136e } @Override -@@ -79,11 +81,18 @@ public class Cow extends Animal { +@@ -78,11 +80,18 @@ public class Cow extends Animal { return this.level().purpurConfig.cowTakeDamageFromWater; } @@ -41,15 +41,19 @@ index 4c2cc5ba3c8f15c26f01361e786d25b399747974..da3dfa10e08750e7ad84ff32a0c0136e this.goalSelector.addGoal(1, new PanicGoal(this, 2.0D)); + this.goalSelector.addGoal(1, new net.minecraft.world.entity.ai.goal.MeleeAttackGoal(this, 1.2000000476837158D, true)); // Purpur this.goalSelector.addGoal(2, new BreedGoal(this, 1.0D)); - if (level().purpurConfig.cowFeedMushrooms > 0) this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT, Blocks.RED_MUSHROOM.asItem(), Blocks.BROWN_MUSHROOM.asItem()), false)); else // Purpur - this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, Ingredient.of(Items.WHEAT), false)); -@@ -91,10 +100,11 @@ public class Cow extends Animal { + this.goalSelector.addGoal(3, new TemptGoal(this, 1.25D, (itemstack) -> { + return level().purpurConfig.cowFeedMushrooms > 0 && (itemstack.is(Blocks.RED_MUSHROOM.asItem()) || itemstack.is(Blocks.BROWN_MUSHROOM.asItem())) || itemstack.is(ItemTags.COW_FOOD); // Purpur +@@ -91,6 +100,7 @@ public class Cow extends Animal { this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0D)); this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F)); this.goalSelector.addGoal(7, new RandomLookAroundGoal(this)); + this.targetSelector.addGoal(0, new net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, target -> isNaturallyAggressiveToPlayers)); // Purpur } + @Override +@@ -99,7 +109,7 @@ public class Cow extends Animal { + } + public static AttributeSupplier.Builder createAttributes() { - return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 10.0D).add(Attributes.MOVEMENT_SPEED, 0.20000000298023224D); + return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 10.0D).add(Attributes.MOVEMENT_SPEED, 0.20000000298023224D).add(Attributes.ATTACK_DAMAGE, 0.0D); // Purpur diff --git a/patches/unapplied-server/0212-Option-for-beds-to-explode-on-villager-sleep.patch b/patches/server/0209-Option-for-beds-to-explode-on-villager-sleep.patch similarity index 94% rename from patches/unapplied-server/0212-Option-for-beds-to-explode-on-villager-sleep.patch rename to patches/server/0209-Option-for-beds-to-explode-on-villager-sleep.patch index 0b234718c..f29316cac 100644 --- a/patches/unapplied-server/0212-Option-for-beds-to-explode-on-villager-sleep.patch +++ b/patches/server/0209-Option-for-beds-to-explode-on-villager-sleep.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Option for beds to explode on villager sleep diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index ee509b5eea71c17ff466fb93fe63168710065add..d2b6d094c4b93055a4e6622372c6a0a83bd992a3 100644 +index a7c85c9efd13145cc061a3a0076b44a7af9812b9..1bace0d549ea4a4b45ac4cd1409524989ecac4ca 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -1111,6 +1111,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -1101,6 +1101,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @Override public void startSleeping(BlockPos pos) { diff --git a/patches/unapplied-server/0213-Halloween-options-and-optimizations.patch b/patches/server/0210-Halloween-options-and-optimizations.patch similarity index 85% rename from patches/unapplied-server/0213-Halloween-options-and-optimizations.patch rename to patches/server/0210-Halloween-options-and-optimizations.patch index facc345ba..03547ad0e 100644 --- a/patches/unapplied-server/0213-Halloween-options-and-optimizations.patch +++ b/patches/server/0210-Halloween-options-and-optimizations.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Halloween options and optimizations diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -index 3c7db09c5fbcb9d57febc937158b50634d68a082..08190c45b0807079b77c41203502e355ecaf2e14 100644 +index 76b858d0ab2da7b4cdf39aa6692e2a005958fee2..f7ac3a5b0a7c93240f948394649ad6dba5a1e4b5 100644 --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -@@ -304,7 +304,7 @@ public class Bat extends AmbientCreature { +@@ -301,7 +301,7 @@ public class Bat extends AmbientCreature { int i = world.getMaxLocalRawBrightness(pos); byte b0 = 4; @@ -17,19 +17,19 @@ index 3c7db09c5fbcb9d57febc937158b50634d68a082..08190c45b0807079b77c41203502e355 b0 = 7; } else if (random.nextBoolean()) { return false; -@@ -318,6 +318,7 @@ public class Bat extends AmbientCreature { - private static boolean isSpookySeason = false; - private static final int ONE_HOUR = 20 * 60 * 60; - private static int lastSpookyCheck = -ONE_HOUR; +@@ -311,6 +311,7 @@ public class Bat extends AmbientCreature { + } + } + + public static boolean isHalloweenSeason(Level level) { return level.purpurConfig.forceHalloweenSeason || isHalloween(); } // Purpur private static boolean isHalloween() { - if (net.minecraft.server.MinecraftServer.currentTick - lastSpookyCheck > ONE_HOUR) { LocalDate localdate = LocalDate.now(); + int i = localdate.get(ChronoField.DAY_OF_MONTH); diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -index 3f9e81c0bdd85bec24a1209ad3fd3dc43d988a4f..cb378b343f721c16868a6673aba59856574c7133 100644 +index 919767affe2ede755cf83398436fbf1581ad508f..8515e6360c1630385884a60f652f65fdefeaf540 100644 --- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java +++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java -@@ -143,11 +143,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo +@@ -135,11 +135,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo this.reassessWeaponGoal(); this.setCanPickUpLoot(this.level().paperConfig().entities.behavior.mobsCanAlwaysPickUpLoot.skeletons || randomsource.nextFloat() < 0.55F * difficulty.getSpecialMultiplier()); // Paper - Add world settings for mobs picking up loot if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) { @@ -43,10 +43,10 @@ index 3f9e81c0bdd85bec24a1209ad3fd3dc43d988a4f..cb378b343f721c16868a6673aba59856 this.armorDropChances[EquipmentSlot.HEAD.getIndex()] = 0.0F; } diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index e568d014f577ab705645152446156dc04895b3bf..9e373fa5eba63ed061e666510e01a6d8cdd6997b 100644 +index 53f7659aed2378b36f1923a0208c7f86048eb85b..d5a5e51e23328deac09d6990539d8207b1567912 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -586,11 +586,7 @@ public class Zombie extends Monster { +@@ -575,11 +575,7 @@ public class Zombie extends Monster { } if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) { diff --git a/patches/unapplied-server/0214-Config-for-grindstones.patch b/patches/server/0211-Config-for-grindstones.patch similarity index 66% rename from patches/unapplied-server/0214-Config-for-grindstones.patch rename to patches/server/0211-Config-for-grindstones.patch index 6cb91c2a5..79efc1f17 100644 --- a/patches/unapplied-server/0214-Config-for-grindstones.patch +++ b/patches/server/0211-Config-for-grindstones.patch @@ -5,40 +5,41 @@ Subject: [PATCH] Config for grindstones diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index 23462de504932bd351b8dfacde514fe361343912..2a2bcd0fc2b7653d9087b88e9a01034b51f017b9 100644 +index db9444dda248260372d96ce239a590e88a4c1142..f7948de0180836f5bcf6818fe3a1362445a5befe 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java @@ -130,7 +130,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { - Enchantment enchantment = (Enchantment) entry.getKey(); - Integer integer = (Integer) entry.getValue(); + Enchantment enchantment = (Enchantment) ((Holder) entry.getKey()).value(); + int k = entry.getIntValue(); - if (!enchantment.isCurse()) { + if (!org.purpurmc.purpur.PurpurConfig.grindstoneIgnoredEnchants.contains(enchantment)) { // Purpur - j += enchantment.getMinCost(integer); + j += enchantment.getMinCost(k); } } -@@ -230,7 +230,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { - Entry entry = (Entry) iterator.next(); - Enchantment enchantment = (Enchantment) entry.getKey(); +@@ -229,7 +229,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { + Entry> entry = (Entry) iterator.next(); + Enchantment enchantment = (Enchantment) ((Holder) entry.getKey()).value(); -- if (!enchantment.isCurse() || EnchantmentHelper.getItemEnchantmentLevel(enchantment, itemstack2) == 0) { -+ if (!org.purpurmc.purpur.PurpurConfig.grindstoneIgnoredEnchants.contains(enchantment) || EnchantmentHelper.getItemEnchantmentLevel(enchantment, itemstack2) == 0) { // Purpur - itemstack2.enchant(enchantment, (Integer) entry.getValue()); +- if (!enchantment.isCurse() || itemenchantments_a.getLevel(enchantment) == 0) { ++ if (!org.purpurmc.purpur.PurpurConfig.grindstoneIgnoredEnchants.contains(enchantment) || itemenchantments_a.getLevel(enchantment) == 0) { // Purpur + itemenchantments_a.upgrade(enchantment, entry.getIntValue()); + } } - } -@@ -250,7 +250,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { - } +@@ -240,7 +240,7 @@ public class GrindstoneMenu extends AbstractContainerMenu { + private ItemStack removeNonCursesFrom(ItemStack item) { + ItemEnchantments itemenchantments = EnchantmentHelper.updateEnchantments(item, (itemenchantments_a) -> { + itemenchantments_a.removeIf((holder) -> { +- return !((Enchantment) holder.value()).isCurse(); ++ return !org.purpurmc.purpur.PurpurConfig.grindstoneIgnoredEnchants.contains(holder.value()); + }); + }); - Map map = (Map) EnchantmentHelper.getEnchantments(item).entrySet().stream().filter((entry) -> { -- return ((Enchantment) entry.getKey()).isCurse(); -+ return org.purpurmc.purpur.PurpurConfig.grindstoneIgnoredEnchants.contains((Enchantment) entry.getKey()); // Purpur - }).collect(Collectors.toMap(Entry::getKey, Entry::getValue)); - - EnchantmentHelper.setEnchantments(map, itemstack1); -@@ -266,6 +266,20 @@ public class GrindstoneMenu extends AbstractContainerMenu { - itemstack1.setRepairCost(AnvilMenu.calculateIncreasedRepairCost(itemstack1.getBaseRepairCost())); +@@ -255,6 +255,21 @@ public class GrindstoneMenu extends AbstractContainerMenu { } + item.set(DataComponents.REPAIR_COST, i); ++ + // Purpur start + if (org.purpurmc.purpur.PurpurConfig.grindstoneRemoveAttributes && itemstack1.getTag() != null) { + for (String key : itemstack1.getTag().getAllKeys()) { @@ -53,11 +54,11 @@ index 23462de504932bd351b8dfacde514fe361343912..2a2bcd0fc2b7653d9087b88e9a01034b + } + // Purpur end + - return itemstack1; + return item; } diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index 477639dddb7c5ae0c9cc45a6eca73d82e486409b..7161b449b20b6fb39a16df7a2da652168ccced97 100644 +index 042fd443c98258240042d3ce1650f36e601d72e3..6653162444df443ca990a25fc8b9f3c336841efb 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -309,6 +309,9 @@ public class PurpurConfig { diff --git a/patches/unapplied-server/0215-UPnP-Port-Forwarding.patch b/patches/server/0212-UPnP-Port-Forwarding.patch similarity index 89% rename from patches/unapplied-server/0215-UPnP-Port-Forwarding.patch rename to patches/server/0212-UPnP-Port-Forwarding.patch index 31bc35e97..86b610183 100644 --- a/patches/unapplied-server/0215-UPnP-Port-Forwarding.patch +++ b/patches/server/0212-UPnP-Port-Forwarding.patch @@ -5,10 +5,10 @@ Subject: [PATCH] UPnP Port Forwarding diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0e9cf9f9ad81363cdeacd3da3a776aaad39045f9..ae8025a1c4280cde6b0503e0bcaf468f694a188c 100644 +index 6d84eb68e3160f772d6832513df2bc4db87b594e..0f4fde2097b9db59b6c29935462f305f34747b3b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -310,6 +310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop CODEC = simpleCodec(Block::new); -@@ -320,7 +327,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -312,7 +319,7 @@ public class Block extends BlockBehaviour implements ItemLike { public static void dropResources(BlockState state, LevelAccessor world, BlockPos pos, @Nullable BlockEntity blockEntity) { if (world instanceof ServerLevel) { Block.getDrops(state, (ServerLevel) world, pos, blockEntity).forEach((itemstack) -> { @@ -63,7 +63,7 @@ index 3dc71c4ee8fc9846e49e659c6b5e7b55ea084f14..34b4c19220e73efad9ff22f3798ee7fb }); state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true); } -@@ -339,7 +346,7 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -331,7 +338,7 @@ public class Block extends BlockBehaviour implements ItemLike { event.setExpToDrop(block.getExpDrop(state, serverLevel, pos, net.minecraft.world.item.ItemStack.EMPTY, true)); // Paper - Properly handle xp dropping event.callEvent(); for (org.bukkit.inventory.ItemStack drop : event.getDrops()) { @@ -72,7 +72,7 @@ index 3dc71c4ee8fc9846e49e659c6b5e7b55ea084f14..34b4c19220e73efad9ff22f3798ee7fb } state.spawnAfterBreak(serverLevel, pos, ItemStack.EMPTY, false); // Paper - Properly handle xp dropping block.popExperience(serverLevel, pos, event.getExpToDrop()); // Paper - Properly handle xp dropping -@@ -356,13 +363,53 @@ public class Block extends BlockBehaviour implements ItemLike { +@@ -348,13 +355,53 @@ public class Block extends BlockBehaviour implements ItemLike { // Paper end - Properly handle xp dropping if (world instanceof ServerLevel) { Block.getDrops(state, (ServerLevel) world, pos, blockEntity, entity, tool).forEach((itemstack1) -> { @@ -128,19 +128,19 @@ index 3dc71c4ee8fc9846e49e659c6b5e7b55ea084f14..34b4c19220e73efad9ff22f3798ee7fb double d0 = (double) EntityType.ITEM.getHeight() / 2.0D; double d1 = (double) pos.getX() + 0.5D + Mth.nextDouble(world.random, -0.25D, 0.25D); diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -index 9ea74d37cd951e0dc76d20ed8234b5871035566c..8e1afae66742fc69d5aab1074ba94a3999cbf9b8 100644 +index b0421823684ff6b9474b81675742d2ee3b17edf7..4ea15e17a1393864422edb6d5c57962651abf69a 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java -@@ -6,6 +6,8 @@ import net.minecraft.CrashReportCategory; - import net.minecraft.core.BlockPos; +@@ -17,6 +17,8 @@ import net.minecraft.core.component.PatchedDataComponentMap; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.nbt.CompoundTag; + import net.minecraft.nbt.NbtOps; +import net.minecraft.nbt.ListTag; +import net.minecraft.nbt.StringTag; import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.resources.ResourceLocation; -@@ -73,10 +75,27 @@ public abstract class BlockEntity { +@@ -86,6 +88,14 @@ public abstract class BlockEntity { if (persistentDataTag instanceof CompoundTag) { this.persistentDataContainer.putAll((CompoundTag) persistentDataTag); } @@ -155,24 +155,28 @@ index 9ea74d37cd951e0dc76d20ed8234b5871035566c..8e1afae66742fc69d5aab1074ba94a39 } // CraftBukkit end -- protected void saveAdditional(CompoundTag nbt) {} +@@ -102,6 +112,17 @@ public abstract class BlockEntity { + this.loadAdditional(nbt, registryLookup); + } + ++ // Purpur start + protected void saveAdditional(CompoundTag nbt) { -+ // Purpur start + if (this.persistentDisplayName != null) { + nbt.put("Purpur.persistentDisplayName", StringTag.valueOf(this.persistentDisplayName)); + } + if (this.persistentLore != null) { + nbt.put("Purpur.persistentLore", this.persistentLore); + } -+ // Purpur end + } ++ // Purpur end ++ + protected void saveAdditional(CompoundTag nbt, HolderLookup.Provider registryLookup) {} + + public final CompoundTag saveWithFullMetadata(HolderLookup.Provider registryLookup) { +@@ -381,4 +402,24 @@ public abstract class BlockEntity { - public final CompoundTag saveWithFullMetadata() { - CompoundTag nbttagcompound = this.saveWithoutMetadata(); -@@ -262,4 +281,24 @@ public abstract class BlockEntity { - return tag; + T getOrDefault(DataComponentType type, T fallback); } - // Paper end - Sanitize sent data + // Purpur start + private String persistentDisplayName = null; + private ListTag persistentLore = null; diff --git a/patches/unapplied-server/0220-Signs-allow-color-codes.patch b/patches/server/0217-Signs-allow-color-codes.patch similarity index 84% rename from patches/unapplied-server/0220-Signs-allow-color-codes.patch rename to patches/server/0217-Signs-allow-color-codes.patch index 458a64abf..3c202a537 100644 --- a/patches/unapplied-server/0220-Signs-allow-color-codes.patch +++ b/patches/server/0217-Signs-allow-color-codes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Signs allow color codes diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index 0ba6ecf578e731a9705a384944aed482f829b58d..c0c9265e8acda3cbf0b4f2c3dca3838265a312d3 100644 +index 670aa56c1b7c9e5fabda45b6a048a6cf6084a7d0..85f58f5449ee63a7f592971769b497e521921fcc 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java -@@ -1589,6 +1589,7 @@ public class ServerPlayer extends Player { +@@ -1684,6 +1684,7 @@ public class ServerPlayer extends Player { @Override public void openTextEdit(SignBlockEntity sign, boolean front) { @@ -17,10 +17,10 @@ index 0ba6ecf578e731a9705a384944aed482f829b58d..c0c9265e8acda3cbf0b4f2c3dca38382 this.connection.send(new ClientboundOpenSignEditorPacket(sign.getBlockPos(), front)); } diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -index 927c7ea03560be0c86884cec70ee8e408e66cb07..93764bf849ad8e427bf119f6ff3dbcbcc4c2415e 100644 +index a28be7a332659be655f419d969e0c64e659b6c21..2f5367fbca7b682eb0ffeab4171b66223f7e5dc6 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java -@@ -200,16 +200,31 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C +@@ -201,16 +201,31 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C return this.setText((SignText) textChanger.apply(signtext), front); } @@ -46,15 +46,15 @@ index 927c7ea03560be0c86884cec70ee8e408e66cb07..93764bf849ad8e427bf119f6ff3dbcbc + org.bukkit.entity.Player player = (org.bukkit.craftbukkit.entity.CraftPlayer) entityhuman.getBukkitEntity(); // Purpur if (entityhuman.isTextFilteringEnabled()) { -- signtext = signtext.setMessage(i, Component.literal(net.minecraft.SharedConstants.filterText(filteredtext.filteredOrEmpty())).setStyle(chatmodifier)); // Paper - filter sign text to chat only -+ signtext = signtext.setMessage(i, translateColors(player, net.minecraft.SharedConstants.filterText(filteredtext.filteredOrEmpty()), chatmodifier)); // Paper - filter sign text to chat only // Purpur +- signtext = signtext.setMessage(i, Component.literal(net.minecraft.util.StringUtil.filterText(filteredtext.filteredOrEmpty())).setStyle(chatmodifier)); // Paper - filter sign text to chat only ++ signtext = signtext.setMessage(i, translateColors(player, net.minecraft.util.StringUtil.filterText(filteredtext.filteredOrEmpty()), chatmodifier)); // Paper - filter sign text to chat only // Purpur } else { -- signtext = signtext.setMessage(i, Component.literal(net.minecraft.SharedConstants.filterText(filteredtext.raw())).setStyle(chatmodifier), Component.literal(net.minecraft.SharedConstants.filterText(filteredtext.filteredOrEmpty())).setStyle(chatmodifier)); // Paper - filter sign text to chat only -+ signtext = signtext.setMessage(i, translateColors(player, net.minecraft.SharedConstants.filterText(filteredtext.raw()), chatmodifier), translateColors(player, net.minecraft.SharedConstants.filterText(filteredtext.filteredOrEmpty()), chatmodifier)); // Paper - filter sign text to chat only // Purpur +- signtext = signtext.setMessage(i, Component.literal(net.minecraft.util.StringUtil.filterText(filteredtext.raw())).setStyle(chatmodifier), Component.literal(net.minecraft.util.StringUtil.filterText(filteredtext.filteredOrEmpty())).setStyle(chatmodifier)); // Paper - filter sign text to chat only ++ signtext = signtext.setMessage(i, translateColors(player, net.minecraft.util.StringUtil.filterText(filteredtext.raw()), chatmodifier), translateColors(player, net.minecraft.util.StringUtil.filterText(filteredtext.filteredOrEmpty()), chatmodifier)); // Paper - filter sign text to chat only // Purpur } } -@@ -349,6 +364,28 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C +@@ -350,6 +365,28 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C return ClientboundBlockEntityDataPacket.create(this); } @@ -81,8 +81,8 @@ index 927c7ea03560be0c86884cec70ee8e408e66cb07..93764bf849ad8e427bf119f6ff3dbcbc + // Purpur end + @Override - public CompoundTag getUpdateTag() { - return this.saveWithoutMetadata(); + public CompoundTag getUpdateTag(HolderLookup.Provider registryLookup) { + return this.saveCustomOnly(registryLookup); diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java index b4d5ae4025d315cfe0e19fa1b077d1c5956523ba..d807da2719c5677c200e5f017e4cf5a1c7fa0ce9 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java diff --git a/patches/unapplied-server/0221-Kelp-cave-weeping-and-twisting-vines-configurable-ma.patch b/patches/server/0218-Kelp-cave-weeping-and-twisting-vines-configurable-ma.patch similarity index 94% rename from patches/unapplied-server/0221-Kelp-cave-weeping-and-twisting-vines-configurable-ma.patch rename to patches/server/0218-Kelp-cave-weeping-and-twisting-vines-configurable-ma.patch index 64bbddeef..e0c4575a3 100644 --- a/patches/unapplied-server/0221-Kelp-cave-weeping-and-twisting-vines-configurable-ma.patch +++ b/patches/server/0218-Kelp-cave-weeping-and-twisting-vines-configurable-ma.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Kelp, cave, weeping, and twisting vines configurable max diff --git a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java -index bdd9f38dcb16b74c5916b75713dbe5082b32497d..65bae6630a11aa1d8d1b08d1f8e2519545ad850c 100644 +index 635fc086d832c641f840cf36d18cdc0fcc3beef3..e3ff7b8059da499cfde1106f6d51156931b292dc 100644 --- a/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CaveVinesBlock.java -@@ -95,4 +95,11 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements Bonemealabl +@@ -94,4 +94,11 @@ public class CaveVinesBlock extends GrowingPlantHeadBlock implements Bonemealabl public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) { world.setBlock(pos, state.setValue(BERRIES, Boolean.valueOf(true)), 2); } @@ -22,7 +22,7 @@ index bdd9f38dcb16b74c5916b75713dbe5082b32497d..65bae6630a11aa1d8d1b08d1f8e25195 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java b/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java -index 30300ef3ec839dfa944c992ab50db4d3859bb02e..0d64b19dbbca9d563d90cabf0e2d32f76bfc0c62 100644 +index cf05da1c86e3018db11dc079bf50317b6639e5cc..8e9903899ac91e9431f00675c1f5ac4a18e61593 100644 --- a/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java +++ b/src/main/java/net/minecraft/world/level/block/GrowingPlantHeadBlock.java @@ -34,12 +34,12 @@ public abstract class GrowingPlantHeadBlock extends GrowingPlantBlock implements @@ -34,7 +34,7 @@ index 30300ef3ec839dfa944c992ab50db4d3859bb02e..0d64b19dbbca9d563d90cabf0e2d32f7 } @Override - public boolean isRandomlyTicking(BlockState state) { + protected boolean isRandomlyTicking(BlockState state) { - return (Integer) state.getValue(GrowingPlantHeadBlock.AGE) < 25; + return (Integer) state.getValue(GrowingPlantHeadBlock.AGE) < getMaxGrowthAge(); // Purpur } @@ -87,11 +87,11 @@ index 30300ef3ec839dfa944c992ab50db4d3859bb02e..0d64b19dbbca9d563d90cabf0e2d32f7 + public abstract int getMaxGrowthAge(); // Purpur } diff --git a/src/main/java/net/minecraft/world/level/block/KelpBlock.java b/src/main/java/net/minecraft/world/level/block/KelpBlock.java -index 1b83d44291029ce978187467832595b6dfd76dd5..69f2c6cae089aa7e1306c9dbe83d4ff582ec777c 100644 +index 784b19bc78c8ad9476b6dac37b6778a409a7c675..d49dd8b20d3785cc9482ed2a34fbd7aed4c9e537 100644 --- a/src/main/java/net/minecraft/world/level/block/KelpBlock.java +++ b/src/main/java/net/minecraft/world/level/block/KelpBlock.java @@ -72,4 +72,11 @@ public class KelpBlock extends GrowingPlantHeadBlock implements LiquidBlockConta - public FluidState getFluidState(BlockState state) { + protected FluidState getFluidState(BlockState state) { return Fluids.WATER.getSource(false); } + @@ -135,7 +135,7 @@ index 3dec5a082606ee35a8c8d7f746480262d6a189c5..b2f6ccae9576c176263e51a232e17a08 + // Purpur end } diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index 43be29d14cd79542358009d7e2cf2d1d56b6fb5d..fe5a35568fdcd24c5020f003f85f3b4d3b4ac631 100644 +index 64c62e4abefb7e95e881fa1d8918e43ae48eb1dd..a1fa16fca204098fd2211a4c206299356fc97724 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -312,6 +312,10 @@ public class PurpurConfig { diff --git a/patches/unapplied-server/0222-Mobs-always-drop-experience.patch b/patches/server/0219-Mobs-always-drop-experience.patch similarity index 91% rename from patches/unapplied-server/0222-Mobs-always-drop-experience.patch rename to patches/server/0219-Mobs-always-drop-experience.patch index 2f040e2da..78bf08657 100644 --- a/patches/unapplied-server/0222-Mobs-always-drop-experience.patch +++ b/patches/server/0219-Mobs-always-drop-experience.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Mobs always drop experience diff --git a/src/main/java/net/minecraft/world/entity/GlowSquid.java b/src/main/java/net/minecraft/world/entity/GlowSquid.java -index d5bcc6e678aec21da855eea805a58a965ef5edee..09181e9a0d4ceac30d20f4ff488a85b0ab5b1d04 100644 +index 70e3d583f7a039a5c67428ce9e8beb1922574c7b..3e2ea26c23e88c395856b65001f2895db6a52bd4 100644 --- a/src/main/java/net/minecraft/world/entity/GlowSquid.java +++ b/src/main/java/net/minecraft/world/entity/GlowSquid.java @@ -51,6 +51,11 @@ public class GlowSquid extends Squid { @@ -21,10 +21,10 @@ index d5bcc6e678aec21da855eea805a58a965ef5edee..09181e9a0d4ceac30d20f4ff488a85b0 protected ParticleOptions getInkParticle() { return ParticleTypes.GLOW_SQUID_INK; diff --git a/src/main/java/net/minecraft/world/entity/ambient/Bat.java b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -index 08190c45b0807079b77c41203502e355ecaf2e14..735445456bbfab8a64df488fed30f0be28d50159 100644 +index f7ac3a5b0a7c93240f948394649ad6dba5a1e4b5..274db35be501d1dd0c5407d350a37b04bf4fbb7e 100644 --- a/src/main/java/net/minecraft/world/entity/ambient/Bat.java +++ b/src/main/java/net/minecraft/world/entity/ambient/Bat.java -@@ -285,6 +285,11 @@ public class Bat extends AmbientCreature { +@@ -282,6 +282,11 @@ public class Bat extends AmbientCreature { return this.level().purpurConfig.batTakeDamageFromWater; } @@ -37,10 +37,10 @@ index 08190c45b0807079b77c41203502e355ecaf2e14..735445456bbfab8a64df488fed30f0be public void readAdditionalSaveData(CompoundTag nbt) { super.readAdditionalSaveData(nbt); diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java -index 8d80055253008bb1b2ed77e91a1c51c995208dac..9fa937d2d6c3b23e390447e4d4fa24543e2679e5 100644 +index 91c013f7ab58f570d0ebe2773932fcdb49344b3c..926c30db9b28a30fe5d6c8d20f3972dec0d7b4d0 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java -@@ -493,6 +493,11 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -482,6 +482,11 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { return this.level().purpurConfig.beeTakeDamageFromWater; } @@ -53,26 +53,26 @@ index 8d80055253008bb1b2ed77e91a1c51c995208dac..9fa937d2d6c3b23e390447e4d4fa2454 public int getRemainingPersistentAngerTime() { return (Integer) this.entityData.get(Bee.DATA_REMAINING_ANGER_TIME); diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java -index d9b19f74b377721ed78cd0ea24d25e412cef1398..6af5e1dfcfd739e0bc857f648c189151d5a795c8 100644 +index 17aaeb734a5c1b16bd7771c909958f3acc956b7a..3e1345f1c534320e07820d573f5c8dba49746425 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Cat.java +++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java -@@ -138,6 +138,11 @@ public class Cat extends TamableAnimal implements VariantHolder { +@@ -144,6 +144,11 @@ public class Cat extends TamableAnimal implements VariantHolder { +@@ -199,6 +199,11 @@ public class Fox extends Animal implements VariantHolder { return this.level().purpurConfig.foxTakeDamageFromWater; } @@ -146,13 +146,13 @@ index 1e04205a1707e46a1f540f5c8f6ec1b81bf1b5d7..445c1993a18da93e89792b7953e5eb71 + } + @Override - protected void defineSynchedData() { - super.defineSynchedData(); + protected void defineSynchedData(SynchedEntityData.Builder builder) { + super.defineSynchedData(builder); diff --git a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java -index 02506902ca7e6f4e4c0fea47499cb8766e33960f..442eb602f5c82550a87e218e2013171b718abd62 100644 +index 8b08476457a6ead1a3c3e2ab35d08a8e0625c43e..12bc57d36d76f49596df0004fda31a6a678be60c 100644 --- a/src/main/java/net/minecraft/world/entity/animal/IronGolem.java +++ b/src/main/java/net/minecraft/world/entity/animal/IronGolem.java -@@ -103,6 +103,11 @@ public class IronGolem extends AbstractGolem implements NeutralMob { +@@ -98,6 +98,11 @@ public class IronGolem extends AbstractGolem implements NeutralMob { this.summoner = summoner; } @@ -165,7 +165,7 @@ index 02506902ca7e6f4e4c0fea47499cb8766e33960f..442eb602f5c82550a87e218e2013171b protected void registerGoals() { if (level().purpurConfig.ironGolemCanSwim) this.goalSelector.addGoal(0, new net.minecraft.world.entity.ai.goal.FloatGoal(this)); // Purpur diff --git a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java -index 5cf206bea6d2f3155c1da73d8337bbd8e2ee7bb3..48ee8c43a91efaadacfe8f37399ea1fb81f5f1ee 100644 +index 6cb8d85986f4d891dfbb66b83163ed23bac694f6..06fac8dae42451f912c2db14d792461cee3dba83 100644 --- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java +++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java @@ -96,6 +96,11 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder { +@@ -152,6 +152,11 @@ public class Rabbit extends Animal implements VariantHolder { public boolean isSensitiveToWater() { return this.level().purpurConfig.rabbitTakeDamageFromWater; } @@ -309,10 +309,10 @@ index e101c3bf425902908c43ffa18867fb83a5e1f16e..382e47f26ee94506cb76463a677351b9 public int getMaxSchoolSize() { return 5; diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java -index d1a8b15de4f4aa20d6049135bcbef94f0d1fb388..ae2662a5cdc4e531e09876ff8664eaf66a63a960 100644 +index afec39ba3b51b121fd7ae937e7bac060ef430dfd..9e617b3f1ec4eac5f83bdf19a3563cdc81b008d8 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java +++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java -@@ -151,6 +151,11 @@ public class Sheep extends Animal implements Shearable { +@@ -149,6 +149,11 @@ public class Sheep extends Animal implements Shearable { return this.level().purpurConfig.sheepTakeDamageFromWater; } @@ -325,10 +325,10 @@ index d1a8b15de4f4aa20d6049135bcbef94f0d1fb388..ae2662a5cdc4e531e09876ff8664eaf6 protected void registerGoals() { this.eatBlockGoal = new EatBlockGoal(this); diff --git a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java -index 81a88d510d7f52ca6a1c9cca991c22c3bdaf6b0d..df8e19a3adfa7dcc065160e8305d0f12c7c37887 100644 +index 8f2348a7fe830a85985ce2b19cb2a9159bca711f..69cdccca01fe7d10e6d958e16d91efe08f699505 100644 --- a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java +++ b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java -@@ -86,6 +86,11 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -84,6 +84,11 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM this.summoner = summoner; } @@ -341,10 +341,10 @@ index 81a88d510d7f52ca6a1c9cca991c22c3bdaf6b0d..df8e19a3adfa7dcc065160e8305d0f12 protected void registerGoals() { this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur diff --git a/src/main/java/net/minecraft/world/entity/animal/Squid.java b/src/main/java/net/minecraft/world/entity/animal/Squid.java -index daa4931c934c792b3c4ff32b730506762c4cf481..fa15e43d19482125e1793e049d1a1380aced906c 100644 +index 0d05879eadeff8731028d78d89d5d32142818ea2..b86676ebcd6c301e5dd857d8e84e1db2c1da416b 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Squid.java +++ b/src/main/java/net/minecraft/world/entity/animal/Squid.java -@@ -95,6 +95,11 @@ public class Squid extends WaterAnimal { +@@ -93,6 +93,11 @@ public class Squid extends WaterAnimal { return this.level().purpurConfig.squidTakeDamageFromWater; } @@ -357,10 +357,10 @@ index daa4931c934c792b3c4ff32b730506762c4cf481..fa15e43d19482125e1793e049d1a1380 protected void registerGoals() { this.goalSelector.addGoal(0, new Squid.SquidRandomMovementGoal(this)); diff --git a/src/main/java/net/minecraft/world/entity/animal/TropicalFish.java b/src/main/java/net/minecraft/world/entity/animal/TropicalFish.java -index 1f83844da76ee6e158f1ba3656ba90d6eff1895c..98205d89aa0cca82863257abfad46ab834385a20 100644 +index 4ac998e9d96aed3b0ea0ec3f9dcd5fdd74c45d24..2d04addd17d2c358fff598012b323cd7d8bf007e 100644 --- a/src/main/java/net/minecraft/world/entity/animal/TropicalFish.java +++ b/src/main/java/net/minecraft/world/entity/animal/TropicalFish.java -@@ -87,6 +87,11 @@ public class TropicalFish extends AbstractSchoolingFish implements VariantHolder +@@ -89,6 +89,11 @@ public class TropicalFish extends AbstractSchoolingFish implements VariantHolder return this.level().purpurConfig.tropicalFishTakeDamageFromWater; } @@ -373,10 +373,10 @@ index 1f83844da76ee6e158f1ba3656ba90d6eff1895c..98205d89aa0cca82863257abfad46ab8 return "entity.minecraft.tropical_fish.predefined." + variant; } diff --git a/src/main/java/net/minecraft/world/entity/animal/Turtle.java b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -index 315006bdb344bb52a077c49a96c7712a33fbb0eb..2153dac7c7c83ef3192d2b8370b8924ee67383a8 100644 +index b146ac72584d998cee4279133b3b19051fbf14c9..01dc59695f295657b1cd7bb015558bfc2ce73b47 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Turtle.java +++ b/src/main/java/net/minecraft/world/entity/animal/Turtle.java -@@ -118,6 +118,11 @@ public class Turtle extends Animal { +@@ -119,6 +119,11 @@ public class Turtle extends Animal { return this.level().purpurConfig.turtleTakeDamageFromWater; } @@ -389,10 +389,10 @@ index 315006bdb344bb52a077c49a96c7712a33fbb0eb..2153dac7c7c83ef3192d2b8370b8924e this.entityData.set(Turtle.HOME_POS, pos.immutable()); // Paper - called with mutablepos... } diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -index 69caba70009268f7af7299f8a1dd84dc43caddf8..a90055fe8819a32180754b6060a0f88e81d1a3b6 100644 +index 5e9678ad46de7faf3136eec49e3b68b14cdfe4a4..ffe2e51cb59f72c878fb63c0c884c572b297f00d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java +++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java -@@ -217,6 +217,11 @@ public class Wolf extends TamableAnimal implements NeutralMob { +@@ -231,6 +231,11 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder getModelRotationValues() { return this.modelRotationValues; diff --git a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -index 5b3126168e9406f6cbd0607b6b7cc2de4ab68b65..f7730ec3a6c8818baf2a7a738e5a49a56d17c0e8 100644 +index 412b44ea2d33ef68721b91da9f550738c6c780ba..79c27b5717fec000ea94138ebc76dbabf5b2eeaf 100644 --- a/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java +++ b/src/main/java/net/minecraft/world/entity/animal/goat/Goat.java -@@ -119,6 +119,11 @@ public class Goat extends Animal { +@@ -118,6 +118,11 @@ public class Goat extends Animal { return this.level().purpurConfig.goatTakeDamageFromWater; } @@ -437,7 +437,7 @@ index 5b3126168e9406f6cbd0607b6b7cc2de4ab68b65..f7730ec3a6c8818baf2a7a738e5a49a5 protected Brain.Provider brainProvider() { return Brain.provider(Goat.MEMORY_TYPES, Goat.SENSOR_TYPES); diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Donkey.java b/src/main/java/net/minecraft/world/entity/animal/horse/Donkey.java -index 92fccfde550f4a01f860e3bcfcf953d3e6ae02e3..42efd14b59a2b7da3409895bdff49e83b6cb2fa5 100644 +index 891ea1cca8495c08a1817096c8c4277f5311d6c7..94021abe521aea4a70f5eaa78fb05f9f71b7c38c 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/Donkey.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/Donkey.java @@ -47,6 +47,11 @@ public class Donkey extends AbstractChestedHorse { @@ -453,10 +453,10 @@ index 92fccfde550f4a01f860e3bcfcf953d3e6ae02e3..42efd14b59a2b7da3409895bdff49e83 protected SoundEvent getAmbientSound() { return SoundEvents.DONKEY_AMBIENT; diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Horse.java b/src/main/java/net/minecraft/world/entity/animal/horse/Horse.java -index 8e4c3c01613a8944095a099427eb12ced32987a1..eab6efcae632a393924d7245a71c40b57c6e316d 100644 +index e623284b353831d1a540af40e139ac16091dcbf6..fdf9ec418b0fc567e286ac79dbdbeddac568ad67 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/Horse.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/Horse.java -@@ -72,6 +72,11 @@ public class Horse extends AbstractHorse implements VariantHolder { +@@ -76,6 +76,11 @@ public class Horse extends AbstractHorse implements VariantHolder { return this.level().purpurConfig.horseTakeDamageFromWater; } @@ -469,7 +469,7 @@ index 8e4c3c01613a8944095a099427eb12ced32987a1..eab6efcae632a393924d7245a71c40b5 protected void randomizeAttributes(RandomSource random) { this.getAttribute(Attributes.MAX_HEALTH).setBaseValue((double)generateMaxHealth(random::nextInt)); diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java -index 30493e675d6308d65a4d4fa3fea601b6d7e4fa76..22abcf70f51a6752ab6d3f421366adb196e50dfc 100644 +index 12ff4091674f7efb3e324df0df2d798dcbc46027..7d2a5c806fd0f1228c45b8a8b56d7ba13b899a2d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java +++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java @@ -150,6 +150,11 @@ public class Llama extends AbstractChestedHorse implements VariantHolder(this, AbstractPiglin.class, true)); diff --git a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java -index 763b28965418f2146a64c1ecde41ac536502936a..c1125279b80bad8d7b6b273e709c412a0a578318 100644 +index 76d47ba17dd140572a0be40dfda18c24851198bb..451762b3cd023b8c5828f68e2778aada9c50ab85 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zoglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zoglin.java -@@ -109,6 +109,11 @@ public class Zoglin extends Monster implements Enemy, HoglinBase { +@@ -107,6 +107,11 @@ public class Zoglin extends Monster implements Enemy, HoglinBase { return this.level().purpurConfig.zoglinTakeDamageFromWater; } @@ -1029,10 +1029,10 @@ index 763b28965418f2146a64c1ecde41ac536502936a..c1125279b80bad8d7b6b273e709c412a protected Brain.Provider brainProvider() { return Brain.provider(MEMORY_TYPES, SENSOR_TYPES); diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -index 9e373fa5eba63ed061e666510e01a6d8cdd6997b..c531d830f4d6b2d2213e160d7e1a5b50b80dbea5 100644 +index d5a5e51e23328deac09d6990539d8207b1567912..d48d22157a89f98c1bbabc70b0bb31187038176d 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java +++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java -@@ -147,6 +147,11 @@ public class Zombie extends Monster { +@@ -144,6 +144,11 @@ public class Zombie extends Monster { return this.level().purpurConfig.zombieTakeDamageFromWater; } @@ -1045,10 +1045,10 @@ index 9e373fa5eba63ed061e666510e01a6d8cdd6997b..c531d830f4d6b2d2213e160d7e1a5b50 protected void registerGoals() { this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java -index f902814a23ef8a7d3893fc0349d1a0b3c203a123..712f77d4ddad04c7cd89d51c6d0c79c2f3ab9347 100644 +index fe43c744cccdc07d5e449ce3ede85f4c7d898018..091095d1690bdd4d0870910b19e5e4ee3a3f9e7c 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java -@@ -129,6 +129,11 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { +@@ -127,6 +127,11 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder { return level().purpurConfig.zombieVillagerJockeyTryExistingChickens; } @@ -1058,13 +1058,13 @@ index f902814a23ef8a7d3893fc0349d1a0b3c203a123..712f77d4ddad04c7cd89d51c6d0c79c2 + } + @Override - protected void defineSynchedData() { - super.defineSynchedData(); + protected void defineSynchedData(SynchedEntityData.Builder builder) { + super.defineSynchedData(builder); diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java -index e6b653c75a4c3306e06bfcadb4c4b53bccd5aad2..feba8a264bae656244f60296d0511a8046297f73 100644 +index bd2953448e568b1a20bcc6a889cef83b88418548..5bae3215ee0bf222c3bd77b3131f3d01ac6c9c41 100644 --- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java -@@ -106,6 +106,11 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { +@@ -104,6 +104,11 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob { return level().purpurConfig.zombifiedPiglinJockeyTryExistingChickens; } @@ -1077,10 +1077,10 @@ index e6b653c75a4c3306e06bfcadb4c4b53bccd5aad2..feba8a264bae656244f60296d0511a80 public void setPersistentAngerTarget(@Nullable UUID angryAt) { this.persistentAngerTarget = angryAt; diff --git a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java -index 5a42325d4acd32d1e8bd2f8dff1b43f3ef160535..4ba5cb5bf7d82ddfd888f5da9f0b111f9102bed8 100644 +index 9ca294d5177ec7d541433d644d2fb90d937b011c..a69a4d860cf537322cdf96bfd42e55d3fc684dd1 100644 --- a/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/hoglin/Hoglin.java -@@ -124,6 +124,11 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { +@@ -122,6 +122,11 @@ public class Hoglin extends Animal implements Enemy, HoglinBase { return this.level().purpurConfig.hoglinTakeDamageFromWater; } @@ -1093,10 +1093,10 @@ index 5a42325d4acd32d1e8bd2f8dff1b43f3ef160535..4ba5cb5bf7d82ddfd888f5da9f0b111f public boolean canBeLeashed(Player player) { return !this.isLeashed(); diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -index 20ecfcbe948d02bb61b8f673f5330d2f9e60c387..141fa7d4e1b81e90f4d63a3459c9a72bc595d30b 100644 +index e5b24bd8e31ca5748185181bb6741760c86a92a1..811b622945ecf67cff1992c3cdd4fcd84f33fb68 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/Piglin.java -@@ -123,6 +123,11 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento +@@ -121,6 +121,11 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento return this.level().purpurConfig.piglinTakeDamageFromWater; } @@ -1109,10 +1109,10 @@ index 20ecfcbe948d02bb61b8f673f5330d2f9e60c387..141fa7d4e1b81e90f4d63a3459c9a72b public void addAdditionalSaveData(CompoundTag nbt) { super.addAdditionalSaveData(nbt); diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java -index 532b14a6330a72e06b47ababee012762b8f76884..5ae1b1de412aeacbbc5e04299e94351d34631b4c 100644 +index 6c7e0f177382cb6329002dcde270f6ce51f08f9f..71d2501e88a99819ef305fa8715418aad65ec81d 100644 --- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java +++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinBrute.java -@@ -90,6 +90,11 @@ public class PiglinBrute extends AbstractPiglin { +@@ -89,6 +89,11 @@ public class PiglinBrute extends AbstractPiglin { return this.level().purpurConfig.piglinBruteTakeDamageFromWater; } @@ -1125,10 +1125,10 @@ index 532b14a6330a72e06b47ababee012762b8f76884..5ae1b1de412aeacbbc5e04299e94351d return Monster.createMonsterAttributes().add(Attributes.MAX_HEALTH, 50.0).add(Attributes.MOVEMENT_SPEED, 0.35F).add(Attributes.ATTACK_DAMAGE, 7.0); } diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index d2b6d094c4b93055a4e6622372c6a0a83bd992a3..19a3e88ce5ccdd74b049246eb51eaa0783d03d5d 100644 +index 1bace0d549ea4a4b45ac4cd1409524989ecac4ca..17a247455dd853ae98e2f82f64a99bccc4d27438 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -196,6 +196,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -194,6 +194,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler return this.level().purpurConfig.villagerTakeDamageFromWater; } @@ -1141,7 +1141,7 @@ index d2b6d094c4b93055a4e6622372c6a0a83bd992a3..19a3e88ce5ccdd74b049246eb51eaa07 public Brain getBrain() { return (Brain) super.getBrain(); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java -index 657fdbabf18da7ab321e8e95a31d53362c605380..21a7cc86245d2440b8fc757d3664a29de293f7b0 100644 +index 0d11200ab580cc306602c29c61f7619565d8261d..62f5e5cfe5745deced2811d14d0c7ebb2c2c6948 100644 --- a/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java +++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTrader.java @@ -103,6 +103,11 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill diff --git a/patches/unapplied-server/0223-Potion-NamespacedKey.patch b/patches/server/0220-Potion-NamespacedKey.patch similarity index 58% rename from patches/unapplied-server/0223-Potion-NamespacedKey.patch rename to patches/server/0220-Potion-NamespacedKey.patch index b8daf5666..7b8d0b15e 100644 --- a/patches/unapplied-server/0223-Potion-NamespacedKey.patch +++ b/patches/server/0220-Potion-NamespacedKey.patch @@ -5,50 +5,52 @@ Subject: [PATCH] Potion NamespacedKey diff --git a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java -index 5d02e72a39af7b1b01bd894bdac3247ad00c243f..eaa5395d8f30d69745a892fe4e03cc45918b57c2 100644 +index 32cf6ea96aaa2e6bd0cc28fa88492ceea3d34052..9787dd4fc6ca2ed8aba3db7674ad2dc26a529a7a 100644 --- a/src/main/java/net/minecraft/world/effect/MobEffectInstance.java +++ b/src/main/java/net/minecraft/world/effect/MobEffectInstance.java -@@ -36,6 +36,7 @@ public class MobEffectInstance implements Comparable { +@@ -53,6 +53,7 @@ public class MobEffectInstance implements Comparable { private boolean showIcon; @Nullable public MobEffectInstance hiddenEffect; + private org.bukkit.NamespacedKey key; // Purpur - add key - private final Optional factorData; + private final MobEffectInstance.BlendState blendState = new MobEffectInstance.BlendState(); - public MobEffectInstance(MobEffect type) { -@@ -54,8 +55,14 @@ public class MobEffectInstance implements Comparable { - this(type, duration, amplifier, ambient, visible, visible); + public MobEffectInstance(Holder effect) { +@@ -71,8 +72,14 @@ public class MobEffectInstance implements Comparable { + this(effect, duration, amplifier, ambient, visible, visible); } + // Purpur start -+ public MobEffectInstance(MobEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon, @Nullable org.bukkit.NamespacedKey key) { -+ this(type, duration, amplifier, ambient, showParticles, showIcon, null, key, type.createFactorData()); -+ } ++ public MobEffectInstance(Holder effect, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon, @Nullable org.bukkit.NamespacedKey key) { ++ this(effect, duration, amplifier, ambient, showParticles, showIcon, null, key); + // Purpur end ++ } + - public MobEffectInstance(MobEffect type, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon) { -- this(type, duration, amplifier, ambient, showParticles, showIcon, null, type.createFactorData()); -+ this(type, duration, amplifier, ambient, showParticles, showIcon, null, null, type.createFactorData()); // Purpur + public MobEffectInstance(Holder effect, int duration, int amplifier, boolean ambient, boolean showParticles, boolean showIcon) { +- this(effect, duration, amplifier, ambient, showParticles, showIcon, null); ++ this(effect, duration, amplifier, ambient, showParticles, showIcon, null, null); // Purpur } public MobEffectInstance( -@@ -66,6 +73,7 @@ public class MobEffectInstance implements Comparable { +@@ -82,7 +89,8 @@ public class MobEffectInstance implements Comparable { + boolean ambient, boolean showParticles, boolean showIcon, - @Nullable MobEffectInstance hiddenEffect, -+ @Nullable org.bukkit.NamespacedKey key, // Purpur - Optional factorCalculationData +- @Nullable MobEffectInstance hiddenEffect ++ @Nullable MobEffectInstance hiddenEffect, ++ @Nullable org.bukkit.NamespacedKey key // Purpur ) { - this.effect = type; -@@ -74,6 +82,7 @@ public class MobEffectInstance implements Comparable { + this.effect = effect; + this.duration = duration; +@@ -90,6 +98,7 @@ public class MobEffectInstance implements Comparable { this.ambient = ambient; this.visible = showParticles; this.showIcon = showIcon; + this.key = key; // Purpur - add key this.hiddenEffect = hiddenEffect; - this.factorData = factorCalculationData; } -@@ -94,6 +103,7 @@ public class MobEffectInstance implements Comparable { + +@@ -135,6 +144,7 @@ public class MobEffectInstance implements Comparable { this.ambient = that.ambient; this.visible = that.visible; this.showIcon = that.showIcon; @@ -56,7 +58,7 @@ index 5d02e72a39af7b1b01bd894bdac3247ad00c243f..eaa5395d8f30d69745a892fe4e03cc45 } public boolean update(MobEffectInstance that) { -@@ -138,6 +148,13 @@ public class MobEffectInstance implements Comparable { +@@ -179,6 +189,13 @@ public class MobEffectInstance implements Comparable { bl = true; } @@ -70,7 +72,7 @@ index 5d02e72a39af7b1b01bd894bdac3247ad00c243f..eaa5395d8f30d69745a892fe4e03cc45 return bl; } -@@ -181,6 +198,17 @@ public class MobEffectInstance implements Comparable { +@@ -222,6 +239,17 @@ public class MobEffectInstance implements Comparable { return this.showIcon; } @@ -88,7 +90,7 @@ index 5d02e72a39af7b1b01bd894bdac3247ad00c243f..eaa5395d8f30d69745a892fe4e03cc45 public boolean tick(LivingEntity entity, Runnable overwriteCallback) { if (this.hasRemainingDuration()) { int i = this.isInfiniteDuration() ? entity.tickCount : this.duration; -@@ -237,6 +265,12 @@ public class MobEffectInstance implements Comparable { +@@ -286,6 +314,12 @@ public class MobEffectInstance implements Comparable { string = string + ", Show Icon: false"; } @@ -101,7 +103,7 @@ index 5d02e72a39af7b1b01bd894bdac3247ad00c243f..eaa5395d8f30d69745a892fe4e03cc45 return string; } -@@ -251,6 +285,7 @@ public class MobEffectInstance implements Comparable { +@@ -300,6 +334,7 @@ public class MobEffectInstance implements Comparable { && this.duration == mobEffectInstance.duration && this.amplifier == mobEffectInstance.amplifier && this.ambient == mobEffectInstance.ambient @@ -109,57 +111,22 @@ index 5d02e72a39af7b1b01bd894bdac3247ad00c243f..eaa5395d8f30d69745a892fe4e03cc45 && this.effect.equals(mobEffectInstance.effect); } -@@ -275,6 +310,11 @@ public class MobEffectInstance implements Comparable { - nbt.putBoolean("ambient", this.isAmbient()); - nbt.putBoolean("show_particles", this.isVisible()); - nbt.putBoolean("show_icon", this.showIcon()); -+ // Purpur start -+ if (this.key != null) { -+ nbt.putString("key", this.key.toString()); -+ } -+ // Purpur end - if (this.hiddenEffect != null) { - CompoundTag compoundTag = new CompoundTag(); - this.hiddenEffect.save(compoundTag); -@@ -311,6 +351,13 @@ public class MobEffectInstance implements Comparable { - bl3 = nbt.getBoolean("show_icon"); - } - -+ // Purpur start -+ org.bukkit.NamespacedKey key = null; -+ if (nbt.contains("key")) { -+ key = org.bukkit.NamespacedKey.fromString(nbt.getString("key")); -+ } -+ // Purpur end -+ - MobEffectInstance mobEffectInstance = null; - if (nbt.contains("hidden_effect", 10)) { - mobEffectInstance = loadSpecifiedEffect(type, nbt.getCompound("hidden_effect")); -@@ -325,7 +372,7 @@ public class MobEffectInstance implements Comparable { - optional = Optional.empty(); - } - -- return new MobEffectInstance(type, j, Math.max(i, 0), bl, bl2, bl3, mobEffectInstance, optional); -+ return new MobEffectInstance(type, j, Math.max(i, 0), bl, bl2, bl3, mobEffectInstance, key, optional); // Purpur - add key - } - - @Override diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java -index bac3a5c378054481e1a5abaec1f83afde5d64ac1..f1050bf2b9efc54a894426b08989d44566acd875 100644 +index 4a9e6a679530025caa710a152c5249299ceffdf9..ea4f3f606aad69965384c73eb1273ed0644297b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaPotion.java -@@ -45,6 +45,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { - static final ItemMetaKey POTION_COLOR = new ItemMetaKey("CustomPotionColor", "custom-color"); - static final ItemMetaKey ID = new ItemMetaKey("id", "potion-id"); - static final ItemMetaKey DEFAULT_POTION = new ItemMetaKey("Potion", "potion-type"); +@@ -42,6 +42,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { + static final ItemMetaKey POTION_EFFECTS = new ItemMetaKey("custom-effects"); + static final ItemMetaKey POTION_COLOR = new ItemMetaKey("custom-color"); + static final ItemMetaKey DEFAULT_POTION = new ItemMetaKey("potion-type"); + static final ItemMetaKey KEY = new ItemMetaKey("key", "namespacedkey"); // Purpur - add key - // Having an initial "state" in ItemMeta seems bit dirty but the UNCRAFTABLE potion type - // is treated as the empty form of the meta because it represents an empty potion with no effect -@@ -97,7 +98,13 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { - boolean ambient = effect.getBoolean(CraftMetaPotion.AMBIENT.NBT); - boolean particles = effect.contains(CraftMetaPotion.SHOW_PARTICLES.NBT, CraftMagicNumbers.NBT.TAG_BYTE) ? effect.getBoolean(CraftMetaPotion.SHOW_PARTICLES.NBT) : true; - boolean icon = effect.contains(CraftMetaPotion.SHOW_ICON.NBT, CraftMagicNumbers.NBT.TAG_BYTE) ? effect.getBoolean(CraftMetaPotion.SHOW_ICON.NBT) : particles; + private PotionType type; + private List customEffects; +@@ -91,7 +92,13 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { + boolean ambient = effect.isAmbient(); + boolean particles = effect.isVisible(); + boolean icon = effect.showIcon(); - this.customEffects.add(new PotionEffect(type, duration, amp, ambient, particles, icon)); + // Purpur start + NamespacedKey key = null; @@ -169,21 +136,21 @@ index bac3a5c378054481e1a5abaec1f83afde5d64ac1..f1050bf2b9efc54a894426b08989d445 + this.customEffects.add(new PotionEffect(type, duration, amp, ambient, particles, icon, key)); + // Purpur end } - } + }); } -@@ -150,6 +157,11 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { - effectData.putBoolean(CraftMetaPotion.AMBIENT.NBT, effect.isAmbient()); - effectData.putBoolean(CraftMetaPotion.SHOW_PARTICLES.NBT, effect.hasParticles()); - effectData.putBoolean(CraftMetaPotion.SHOW_ICON.NBT, effect.hasIcon()); +@@ -130,6 +137,11 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { + if (this.customEffects != null) { + for (PotionEffect effect : this.customEffects) { + effectList.add(new MobEffectInstance(CraftPotionEffectType.bukkitToMinecraftHolder(effect.getType()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon())); + // Purpur start + if (effect.hasKey()) { + effectData.putString(CraftMetaPotion.KEY.NBT, effect.getKey().toString()); + } + // Purpur end - effectList.add(effectData); } } -@@ -225,7 +237,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { + +@@ -196,7 +208,7 @@ class CraftMetaPotion extends CraftMetaItem implements PotionMeta { if (index != -1) { if (overwrite) { PotionEffect old = this.customEffects.get(index); @@ -193,19 +160,19 @@ index bac3a5c378054481e1a5abaec1f83afde5d64ac1..f1050bf2b9efc54a894426b08989d445 } this.customEffects.set(index, effect); diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java -index e938255fcc5db0c289d3e132175a541187e4a748..f7a747ea73a80c97d863e0fd3772a0c333aef3c8 100644 +index 14c58cf8d255c51473fd3d0092faeaf5a3c1ae0c..3ee9c14440046872b83de628b7f460d0782e9315 100644 --- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java +++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionUtil.java -@@ -74,7 +74,7 @@ public class CraftPotionUtil { +@@ -11,7 +11,7 @@ public class CraftPotionUtil { public static MobEffectInstance fromBukkit(PotionEffect effect) { - MobEffect type = CraftPotionEffectType.bukkitToMinecraft(effect.getType()); + Holder type = CraftPotionEffectType.bukkitToMinecraftHolder(effect.getType()); // Paper - Note: do not copy over the hidden effect, as this method is only used for applying to entities which we do not want to convert over. - return new MobEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon()); // Paper + return new MobEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles(), effect.hasIcon(), effect.getKey()); // Paper // Purpur - add key } public static PotionEffect toBukkit(MobEffectInstance effect) { -@@ -83,7 +83,7 @@ public class CraftPotionUtil { +@@ -20,7 +20,7 @@ public class CraftPotionUtil { int duration = effect.getDuration(); boolean ambient = effect.isAmbient(); boolean particles = effect.isVisible(); @@ -213,20 +180,20 @@ index e938255fcc5db0c289d3e132175a541187e4a748..f7a747ea73a80c97d863e0fd3772a0c3 + return new PotionEffect(type, duration, amp, ambient, particles, effect.showIcon(), effect.hiddenEffect == null ? null : toBukkit(effect.hiddenEffect), effect.getKey()); // Paper // Purpur - add key } - public static boolean equals(MobEffect mobEffect, PotionEffectType type) { + public static boolean equals(Holder mobEffect, PotionEffectType type) { diff --git a/src/test/java/org/bukkit/potion/PotionTest.java b/src/test/java/org/bukkit/potion/PotionTest.java -index 8963d93e99bdaf719fa160c11dd5af6a1d86f9a4..d852d8b14f5000415cbb4f06601059b3934b7efc 100644 +index cbcd1c21646308b2a9706095e2e12177ca06734d..b3ccaea713e858e334cc91d1ae498e589e3daafa 100644 --- a/src/test/java/org/bukkit/potion/PotionTest.java +++ b/src/test/java/org/bukkit/potion/PotionTest.java -@@ -9,6 +9,7 @@ import net.minecraft.resources.ResourceLocation; - import net.minecraft.world.effect.MobEffect; +@@ -10,6 +10,7 @@ import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffectInstance; import net.minecraft.world.item.alchemy.Potion; -+import org.bukkit.NamespacedKey; + import org.bukkit.craftbukkit.legacy.FieldRename; ++import org.bukkit.NamespacedKey; // Purpur import org.bukkit.craftbukkit.potion.CraftPotionEffectType; import org.bukkit.support.AbstractTestingBase; import org.junit.jupiter.api.Test; -@@ -46,4 +47,27 @@ public class PotionTest extends AbstractTestingBase { +@@ -47,4 +48,27 @@ public class PotionTest extends AbstractTestingBase { assertEquals(bukkit, byName, "Same type not returned by name " + key); } } diff --git a/patches/unapplied-server/0224-Grindstone-API.patch b/patches/server/0221-Grindstone-API.patch similarity index 92% rename from patches/unapplied-server/0224-Grindstone-API.patch rename to patches/server/0221-Grindstone-API.patch index 54d59ad04..71aa41021 100644 --- a/patches/unapplied-server/0224-Grindstone-API.patch +++ b/patches/server/0221-Grindstone-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Grindstone API diff --git a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java -index 2a2bcd0fc2b7653d9087b88e9a01034b51f017b9..af99ce32872e079beb6ac1caf3a8ac4c3cae4648 100644 +index f7948de0180836f5bcf6818fe3a1362445a5befe..3756543f05bfe56b0b5333281902fa200dad6951 100644 --- a/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java +++ b/src/main/java/net/minecraft/world/inventory/GrindstoneMenu.java @@ -95,9 +95,11 @@ public class GrindstoneMenu extends AbstractContainerMenu { @@ -21,7 +21,7 @@ index 2a2bcd0fc2b7653d9087b88e9a01034b51f017b9..af99ce32872e079beb6ac1caf3a8ac4c } world.levelEvent(1042, blockposition, 0); -@@ -341,7 +343,9 @@ public class GrindstoneMenu extends AbstractContainerMenu { +@@ -331,7 +333,9 @@ public class GrindstoneMenu extends AbstractContainerMenu { return ItemStack.EMPTY; } diff --git a/patches/unapplied-server/0225-Ability-for-hoe-to-replant-crops-and-nether-warts.patch b/patches/server/0222-Ability-for-hoe-to-replant-crops-and-nether-warts.patch similarity index 92% rename from patches/unapplied-server/0225-Ability-for-hoe-to-replant-crops-and-nether-warts.patch rename to patches/server/0222-Ability-for-hoe-to-replant-crops-and-nether-warts.patch index 3d58f8c07..bd6dca784 100644 --- a/patches/unapplied-server/0225-Ability-for-hoe-to-replant-crops-and-nether-warts.patch +++ b/patches/server/0222-Ability-for-hoe-to-replant-crops-and-nether-warts.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Ability for hoe to replant crops and nether warts diff --git a/src/main/java/net/minecraft/world/level/block/BushBlock.java b/src/main/java/net/minecraft/world/level/block/BushBlock.java -index bed3d9c781c7d3ca260027b4737970889a54689c..db1941ed32d141327a8b11e54b3ff9900072ad36 100644 +index a7b4b5600e3c889c69ac22294899713d50b5fe5c..a27e298ffdfa6956be9cde429d2cd45483a51fed 100644 --- a/src/main/java/net/minecraft/world/level/block/BushBlock.java +++ b/src/main/java/net/minecraft/world/level/block/BushBlock.java @@ -52,4 +52,24 @@ public abstract class BushBlock extends Block { - public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) { - return type == PathComputationType.AIR && !this.hasCollision ? true : super.isPathfindable(state, world, pos, type); + protected boolean isPathfindable(BlockState state, PathComputationType type) { + return type == PathComputationType.AIR && !this.hasCollision ? true : super.isPathfindable(state, type); } + + // Purpur start @@ -34,7 +34,7 @@ index bed3d9c781c7d3ca260027b4737970889a54689c..db1941ed32d141327a8b11e54b3ff990 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/CropBlock.java b/src/main/java/net/minecraft/world/level/block/CropBlock.java -index 55e28eef76d9d534037d888d85c0609052478118..2077cb5dcf2352c9d5b502744aeb9a66df256939 100644 +index a69e7e8da81bd13578d230cc1e3f0f900817cbfd..5a190834baef60c7b61074393f8856a933902d81 100644 --- a/src/main/java/net/minecraft/world/level/block/CropBlock.java +++ b/src/main/java/net/minecraft/world/level/block/CropBlock.java @@ -214,4 +214,15 @@ public class CropBlock extends BushBlock implements BonemealableBlock { @@ -54,7 +54,7 @@ index 55e28eef76d9d534037d888d85c0609052478118..2077cb5dcf2352c9d5b502744aeb9a66 + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java b/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java -index 0fc333f240d6918e841a9221be42973839408802..464a9d2e4c694d5d4aae6c2d3e8a5fad0111e910 100644 +index acbd60a2f162fe0e254e36d0e8e7face3fc8a7b3..da1c7999ca64199387054de46489d3ff4a299289 100644 --- a/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java +++ b/src/main/java/net/minecraft/world/level/block/NetherWartBlock.java @@ -68,4 +68,15 @@ public class NetherWartBlock extends BushBlock { diff --git a/patches/unapplied-server/0226-Turtle-eggs-random-tick-crack-chance.patch b/patches/server/0223-Turtle-eggs-random-tick-crack-chance.patch similarity index 93% rename from patches/unapplied-server/0226-Turtle-eggs-random-tick-crack-chance.patch rename to patches/server/0223-Turtle-eggs-random-tick-crack-chance.patch index 2f53c8423..8f7e8aae8 100644 --- a/patches/unapplied-server/0226-Turtle-eggs-random-tick-crack-chance.patch +++ b/patches/server/0223-Turtle-eggs-random-tick-crack-chance.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Turtle eggs random tick crack chance diff --git a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java -index 430ccf1b9f5c6306bbe610d1f9058c1a4bfa2986..b18545e1bd55fa468af6d6c03211036eb9fa146d 100644 +index 0c732cfbd9ce50198a3f85ae8ef2263d7ae0bc1a..2f0e8aeb9c45853fca12ddd78a7d51813a600e67 100644 --- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java -@@ -169,7 +169,7 @@ public class TurtleEggBlock extends Block { +@@ -170,7 +170,7 @@ public class TurtleEggBlock extends Block { private boolean shouldUpdateHatchLevel(Level world) { float f = world.getTimeOfDay(1.0F); diff --git a/patches/unapplied-server/0227-Mob-head-visibility-percent.patch b/patches/server/0224-Mob-head-visibility-percent.patch similarity index 97% rename from patches/unapplied-server/0227-Mob-head-visibility-percent.patch rename to patches/server/0224-Mob-head-visibility-percent.patch index 8693603bf..1611faa05 100644 --- a/patches/unapplied-server/0227-Mob-head-visibility-percent.patch +++ b/patches/server/0224-Mob-head-visibility-percent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Mob head visibility percent diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 3a1b8a94642339a96d8f7391714fae1648dc5149..21019c1484a281e6cbcaf1c3e462efa106fee5eb 100644 +index d85407573c47df162cedb8667c2fbc327e75588b..bfb9d3c92950b2600320ba3af409acbf810b5fe7 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1049,9 +1049,20 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1071,9 +1071,20 @@ public abstract class LivingEntity extends Entity implements Attackable { ItemStack itemstack = this.getItemBySlot(EquipmentSlot.HEAD); EntityType entitytypes = entity.getType(); diff --git a/patches/unapplied-server/0228-Configurable-valid-characters-for-usernames.patch b/patches/server/0225-Configurable-valid-characters-for-usernames.patch similarity index 69% rename from patches/unapplied-server/0228-Configurable-valid-characters-for-usernames.patch rename to patches/server/0225-Configurable-valid-characters-for-usernames.patch index 7c293be87..473ae940d 100644 --- a/patches/unapplied-server/0228-Configurable-valid-characters-for-usernames.patch +++ b/patches/server/0225-Configurable-valid-characters-for-usernames.patch @@ -4,20 +4,20 @@ Date: Sat, 1 Jan 2022 18:38:58 -0600 Subject: [PATCH] Configurable valid characters for usernames -diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index e8000f236d3ec0476ec782f08e159eea6c99476a..4297622fecf2cde16cdcb206ecc3e912b06c0a66 100644 ---- a/src/main/java/net/minecraft/world/entity/player/Player.java -+++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -2429,6 +2429,7 @@ public abstract class Player extends LivingEntity { +diff --git a/src/main/java/net/minecraft/util/StringUtil.java b/src/main/java/net/minecraft/util/StringUtil.java +index ae7ef47446c15b8a6878dd2d31b60cd0670eaf83..118841518668c82f0031ec97fd89819a06f72c6b 100644 +--- a/src/main/java/net/minecraft/util/StringUtil.java ++++ b/src/main/java/net/minecraft/util/StringUtil.java +@@ -64,6 +64,7 @@ public class StringUtil { } - public static boolean isValidUsername(String name) { + public static boolean isValidPlayerName(String name) { + if (true) return org.purpurmc.purpur.PurpurConfig.usernameValidCharactersPattern.matcher(name).matches(); // Purpur // Paper start - username validation overriding if (name == null || name.isEmpty() || name.length() > 16) { return false; diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index fe5a35568fdcd24c5020f003f85f3b4d3b4ac631..e24cd4274bfe7d8694a91f74a2f4674befb13bd6 100644 +index a1fa16fca204098fd2211a4c206299356fc97724..107852247029b748a3e6e17b0ddbecdb50ce6d29 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -452,4 +452,11 @@ public class PurpurConfig { diff --git a/patches/unapplied-server/0229-Shears-can-have-looting-enchantment.patch b/patches/server/0226-Shears-can-have-looting-enchantment.patch similarity index 67% rename from patches/unapplied-server/0229-Shears-can-have-looting-enchantment.patch rename to patches/server/0226-Shears-can-have-looting-enchantment.patch index b047a28aa..978576f5f 100644 --- a/patches/unapplied-server/0229-Shears-can-have-looting-enchantment.patch +++ b/patches/server/0226-Shears-can-have-looting-enchantment.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Shears can have looting enchantment diff --git a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java -index 8d65cdb013706a932c2c73231108b2810b99e1c7..5b1938fc849db743e65cd7eed0f83ba059b9525e 100644 +index a024c697a65bbab27408da1d6a75e531d9719b47..64bbb3da8a75a90d85cdd3ac90a95c670ee032ae 100644 --- a/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java +++ b/src/main/java/net/minecraft/core/dispenser/ShearsDispenseItemBehavior.java -@@ -104,7 +104,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior { +@@ -105,7 +105,7 @@ public class ShearsDispenseItemBehavior extends OptionalDispenseItemBehavior { if (ishearable.readyForShearing()) { // CraftBukkit start // Paper start - Add drops to shear events @@ -31,19 +31,19 @@ index 2ee48ac3b665db2b02bcb1a30ec972d43a3725b0..59e8f5431ce5026209e1428b5fa5b548 } // Paper end - custom shear drops diff --git a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java -index 48ee8c43a91efaadacfe8f37399ea1fb81f5f1ee..21632120b52e4d594153ebe057a14afa74c3f4eb 100644 +index 06fac8dae42451f912c2db14d792461cee3dba83..a7c95199234231db14faa4a07953bcde57d9861d 100644 --- a/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java +++ b/src/main/java/net/minecraft/world/entity/animal/MushroomCow.java @@ -161,7 +161,7 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder drops = this.generateDefaultDrops(); -+ List drops = this.generateDefaultDrops(net.minecraft.world.item.enchantment.EnchantmentHelper.getMobLooting(player)); // Purpur +- java.util.List drops = this.generateDefaultDrops(); ++ java.util.List drops = this.generateDefaultDrops(net.minecraft.world.item.enchantment.EnchantmentHelper.getMobLooting(player)); // Purpur org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops); if (event != null) { if (event.isCancelled()) { -@@ -213,13 +213,13 @@ public class MushroomCow extends Cow implements Shearable, VariantHolder generateDefaultDrops() { -+ public List generateDefaultDrops(int looting) { // Purpur - List dropEntities = new java.util.ArrayList<>(5); +- public java.util.List generateDefaultDrops() { ++ public java.util.List generateDefaultDrops(int looting) { // Purpur + java.util.List dropEntities = new java.util.ArrayList<>(5); - for (int i = 0; i < 5; ++i) { + for (int i = 0; i < 5 + (org.purpurmc.purpur.PurpurConfig.allowShearsLooting ? looting : 0); ++i) { // Purpur dropEntities.add(new ItemStack(this.getVariant().getBlockState().getBlock())); } return dropEntities; diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java -index ae2662a5cdc4e531e09876ff8664eaf66a63a960..658f7943d275267d3fc556572831cc095259d12e 100644 +index 9e617b3f1ec4eac5f83bdf19a3563cdc81b008d8..6b1244d3957e7f62c96ffd34692b8916337839fd 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java +++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java -@@ -292,7 +292,7 @@ public class Sheep extends Animal implements Shearable { +@@ -297,7 +297,7 @@ public class Sheep extends Animal implements Shearable { if (!this.level().isClientSide && this.readyForShearing()) { // CraftBukkit start // Paper start - custom shear drops @@ -73,7 +73,7 @@ index ae2662a5cdc4e531e09876ff8664eaf66a63a960..658f7943d275267d3fc556572831cc09 org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops); if (event != null) { if (event.isCancelled()) { -@@ -319,12 +319,13 @@ public class Sheep extends Animal implements Shearable { +@@ -322,12 +322,13 @@ public class Sheep extends Animal implements Shearable { @Override public void shear(SoundSource shearedSoundCategory) { // Paper start - custom shear drops @@ -90,10 +90,10 @@ index ae2662a5cdc4e531e09876ff8664eaf66a63a960..658f7943d275267d3fc556572831cc09 for (int j = 0; j < count; ++j) { dropEntities.add(new ItemStack(Sheep.ITEM_BY_DYE.get(this.getColor()))); diff --git a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java -index df8e19a3adfa7dcc065160e8305d0f12c7c37887..b75d07f3af4addbb306ecb6baacf1607ef65fc25 100644 +index 69cdccca01fe7d10e6d958e16d91efe08f699505..3b74931ae4e3a869d8db38c119e57b44af887859 100644 --- a/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java +++ b/src/main/java/net/minecraft/world/entity/animal/SnowGolem.java -@@ -196,7 +196,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -189,7 +189,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM if (itemstack.is(Items.SHEARS) && this.readyForShearing()) { // CraftBukkit start // Paper start - custom shear drops @@ -102,7 +102,7 @@ index df8e19a3adfa7dcc065160e8305d0f12c7c37887..b75d07f3af4addbb306ecb6baacf1607 org.bukkit.event.player.PlayerShearEntityEvent event = CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemstack, hand, drops); if (event != null) { if (event.isCancelled()) { -@@ -231,11 +231,20 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM +@@ -222,11 +222,20 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM @Override public void shear(SoundSource shearedSoundCategory) { // Paper start - custom shear drops @@ -125,62 +125,14 @@ index df8e19a3adfa7dcc065160e8305d0f12c7c37887..b75d07f3af4addbb306ecb6baacf1607 return java.util.Collections.singletonList(new ItemStack(Items.CARVED_PUMPKIN)); } -diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentCategory.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentCategory.java -index cc83aa539f8538fbaed8a3e52d9d9d8901e4793d..4f8d8665cb90b746dc59913ec270839c4e5dba91 100644 ---- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentCategory.java -+++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentCategory.java -@@ -120,6 +120,12 @@ public enum EnchantmentCategory { - public boolean canEnchant(Item item) { - return item instanceof BowItem || item instanceof CrossbowItem; - } -+ }, -+ WEAPON_AND_SHEARS { -+ @Override -+ public boolean canEnchant(Item item) { -+ return WEAPON.canEnchant(item) || item instanceof net.minecraft.world.item.ShearsItem; -+ } - // Purpur end - }; - -diff --git a/src/main/java/net/minecraft/world/item/enchantment/LootBonusEnchantment.java b/src/main/java/net/minecraft/world/item/enchantment/LootBonusEnchantment.java -index 7f1ffc0ac402fcf0ec086986e959ecc9f78dde03..1351d52374d1c2367932e5ecd5f4637955fb14c9 100644 ---- a/src/main/java/net/minecraft/world/item/enchantment/LootBonusEnchantment.java -+++ b/src/main/java/net/minecraft/world/item/enchantment/LootBonusEnchantment.java -@@ -7,6 +7,14 @@ public class LootBonusEnchantment extends Enchantment { - super(rarity, target, slotTypes); - } - -+ // Purpur start -+ @Override -+ public boolean canEnchant(net.minecraft.world.item.ItemStack stack) { -+ // we have to cheat the system because this class is loaded before purpur's config is loaded -+ return (org.purpurmc.purpur.PurpurConfig.allowShearsLooting && this.category == EnchantmentCategory.WEAPON ? EnchantmentCategory.WEAPON_AND_SHEARS : this.category).canEnchant(stack.getItem()); -+ } -+ // Purpur end -+ - @Override - public int getMinCost(int level) { - return 15 + (level - 1) * 9; -diff --git a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -index c1be4eb145e1a7e7749d24958bfed5c8268f1131..40d385c7865726545bb66f9a1856ed4e73e60202 100644 ---- a/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -+++ b/src/main/java/org/bukkit/craftbukkit/enchantments/CraftEnchantment.java -@@ -72,6 +72,7 @@ public class CraftEnchantment extends Enchantment implements Handleable EnchantmentTarget.CROSSBOW; - case VANISHABLE -> EnchantmentTarget.VANISHABLE; - case BOW_AND_CROSSBOW -> EnchantmentTarget.BOW_AND_CROSSBOW; // Purpur -+ case WEAPON_AND_SHEARS -> EnchantmentTarget.WEAPON_AND_SHEARS; // Purpur - }; - } - diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index e24cd4274bfe7d8694a91f74a2f4674befb13bd6..ffff69021335ca52d10a07bb3b3f272eea6ebcb5 100644 +index 107852247029b748a3e6e17b0ddbecdb50ce6d29..19e54e22ca2e024074c28dda3bbdf75ce9f1b083 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -391,6 +391,7 @@ public class PurpurConfig { public static boolean allowInfinityMending = false; - public static boolean allowCrossbowInfinity = false; + public static boolean allowCrossbowInfinity = true; + public static boolean allowShearsLooting = false; public static boolean allowUnsafeEnchants = false; public static boolean allowInapplicableEnchants = true; diff --git a/patches/unapplied-server/0230-Stop-bees-from-dying-after-stinging.patch b/patches/server/0227-Stop-bees-from-dying-after-stinging.patch similarity index 92% rename from patches/unapplied-server/0230-Stop-bees-from-dying-after-stinging.patch rename to patches/server/0227-Stop-bees-from-dying-after-stinging.patch index 7a0dc55be..3d0ecb450 100644 --- a/patches/unapplied-server/0230-Stop-bees-from-dying-after-stinging.patch +++ b/patches/server/0227-Stop-bees-from-dying-after-stinging.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Stop bees from dying after stinging diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java -index 9fa937d2d6c3b23e390447e4d4fa24543e2679e5..c2dae3636145105ecb3ae950e07095f278f72ac2 100644 +index 926c30db9b28a30fe5d6c8d20f3972dec0d7b4d0..221c0051c7a0e20c1b7a464df26eb63c4e997eee 100644 --- a/src/main/java/net/minecraft/world/entity/animal/Bee.java +++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java -@@ -446,6 +446,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { +@@ -435,6 +435,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal { this.hurt(this.damageSources().drown(), 1.0F); } diff --git a/patches/unapplied-server/0231-Give-bee-counts-in-beehives-to-Purpur-clients.patch b/patches/server/0228-Give-bee-counts-in-beehives-to-Purpur-clients.patch similarity index 92% rename from patches/unapplied-server/0231-Give-bee-counts-in-beehives-to-Purpur-clients.patch rename to patches/server/0228-Give-bee-counts-in-beehives-to-Purpur-clients.patch index 6619e6cf9..39d510ede 100644 --- a/patches/unapplied-server/0231-Give-bee-counts-in-beehives-to-Purpur-clients.patch +++ b/patches/server/0228-Give-bee-counts-in-beehives-to-Purpur-clients.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Give bee counts in beehives to Purpur clients diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ae8025a1c4280cde6b0503e0bcaf468f694a188c..1e017c7c33fd70803312efdd61e090cb8aaf2254 100644 +index 0f4fde2097b9db59b6c29935462f305f34747b3b..5081a631a94920db0307341261755eac399fea1e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1063,6 +1063,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop Actual fall distance needed to trample 6.0 -> 6.75 diff --git a/src/main/java/net/minecraft/world/level/block/FarmBlock.java b/src/main/java/net/minecraft/world/level/block/FarmBlock.java -index 00a6aa924e47e18ae80b57e9fe1d38e2de15dd72..0c39126ce51439cce05747161aba43bce33a12d8 100644 +index 6b12864f323202a1202a59f66412b3d5be28023f..a208649685bbb33302445b54540e68dfa5212f78 100644 --- a/src/main/java/net/minecraft/world/level/block/FarmBlock.java +++ b/src/main/java/net/minecraft/world/level/block/FarmBlock.java -@@ -110,7 +110,7 @@ public class FarmBlock extends Block { +@@ -111,7 +111,7 @@ public class FarmBlock extends Block { @Override public void fallOn(Level world, BlockState state, BlockPos pos, Entity entity, float fallDistance) { super.fallOn(world, state, pos, entity, fallDistance); // CraftBukkit - moved here as game rules / events shouldn't affect fall damage. diff --git a/patches/unapplied-server/0233-Configurable-player-pickup-exp-delay.patch b/patches/server/0230-Configurable-player-pickup-exp-delay.patch similarity index 92% rename from patches/unapplied-server/0233-Configurable-player-pickup-exp-delay.patch rename to patches/server/0230-Configurable-player-pickup-exp-delay.patch index 86fac4794..a3c42a40f 100644 --- a/patches/unapplied-server/0233-Configurable-player-pickup-exp-delay.patch +++ b/patches/server/0230-Configurable-player-pickup-exp-delay.patch @@ -9,10 +9,10 @@ players still only pick up one orb every tick. However, setting this to any negative number will pick up all orbs instantly. diff --git a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -index c8671996f07f1daafe48448f4a5b837ca2f658c6..373a932b80be18b8a47ef849ce837dbfbba6f9cb 100644 +index 7ca70e9ddda24e2fe661c7b13fa439a6c19726dd..ce608784e0e35b67dde377436aaf42c956ce0644 100644 --- a/src/main/java/net/minecraft/world/entity/ExperienceOrb.java +++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java -@@ -314,7 +314,7 @@ public class ExperienceOrb extends Entity { +@@ -320,7 +320,7 @@ public class ExperienceOrb extends Entity { public void playerTouch(Player player) { if (!this.level().isClientSide) { if (player.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((net.minecraft.server.level.ServerPlayer) player).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - PlayerPickupExperienceEvent @@ -22,10 +22,10 @@ index c8671996f07f1daafe48448f4a5b837ca2f658c6..373a932b80be18b8a47ef849ce837dbf int i = this.repairPlayerItems(player, this.value); diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java -index 4297622fecf2cde16cdcb206ecc3e912b06c0a66..43199815ffe3d666577390b96187aa898ceb910e 100644 +index 44ef706008a1477d2073c29f2c9d016bf91e15a6..102da46e66ac3a395af98fdb0013587ec6d7b48f 100644 --- a/src/main/java/net/minecraft/world/entity/player/Player.java +++ b/src/main/java/net/minecraft/world/entity/player/Player.java -@@ -633,7 +633,7 @@ public abstract class Player extends LivingEntity { +@@ -632,7 +632,7 @@ public abstract class Player extends LivingEntity { while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); diff --git a/patches/unapplied-server/0234-Allow-void-trading.patch b/patches/server/0231-Allow-void-trading.patch similarity index 94% rename from patches/unapplied-server/0234-Allow-void-trading.patch rename to patches/server/0231-Allow-void-trading.patch index 3358bf825..270677cdf 100644 --- a/patches/unapplied-server/0234-Allow-void-trading.patch +++ b/patches/server/0231-Allow-void-trading.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow void trading diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 39a6ff48d820b56728398ac287f9a4db108f3bad..b9ca61e2ec4318c55997840f33fc8eae926fda73 100644 +index 42db3e64b120b753e98a0fd7e3f56c7d28256fd2..ae2b9732b2795ea7faec96af4c27ccb04f772307 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java -@@ -2920,7 +2920,7 @@ public class ServerLevel extends Level implements WorldGenLevel { +@@ -2855,7 +2855,7 @@ public class ServerLevel extends Level implements WorldGenLevel { // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message // Paper start - Fix merchant inventory not closing on entity removal diff --git a/patches/unapplied-server/0235-Configurable-phantom-size.patch b/patches/server/0232-Configurable-phantom-size.patch similarity index 91% rename from patches/unapplied-server/0235-Configurable-phantom-size.patch rename to patches/server/0232-Configurable-phantom-size.patch index 422923628..5d94dafde 100644 --- a/patches/unapplied-server/0235-Configurable-phantom-size.patch +++ b/patches/server/0232-Configurable-phantom-size.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Configurable phantom size diff --git a/src/main/java/net/minecraft/world/entity/monster/Phantom.java b/src/main/java/net/minecraft/world/entity/monster/Phantom.java -index 8591fb95aa3079d7722f445ce1b1743c1f02b9bc..44a24707530ca46a6a42e8a4d9049e75f65aa66b 100644 +index 0d81540d048cd4a08962bd24d3bdd49db708f83f..26077bd6eeedbdae84613188cb0f336abb3563d2 100644 --- a/src/main/java/net/minecraft/world/entity/monster/Phantom.java +++ b/src/main/java/net/minecraft/world/entity/monster/Phantom.java -@@ -272,7 +272,11 @@ public class Phantom extends FlyingMob implements Enemy { +@@ -265,7 +265,11 @@ public class Phantom extends FlyingMob implements Enemy { @Override - public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) { + public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData) { this.anchorPoint = this.blockPosition().above(5); - this.setPhantomSize(0); + // Purpur start @@ -18,7 +18,7 @@ index 8591fb95aa3079d7722f445ce1b1743c1f02b9bc..44a24707530ca46a6a42e8a4d9049e75 + int max = world.getLevel().purpurConfig.phantomMaxSize; + this.setPhantomSize(min == max ? min : world.getRandom().nextInt(max + 1 - min) + min); + // Purpur end - return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt); + return super.finalizeSpawn(world, difficulty, spawnReason, entityData); } diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java diff --git a/patches/unapplied-server/0237-Max-joins-per-second.patch b/patches/server/0233-Max-joins-per-second.patch similarity index 90% rename from patches/unapplied-server/0237-Max-joins-per-second.patch rename to patches/server/0233-Max-joins-per-second.patch index f80e8148a..46482bbe9 100644 --- a/patches/unapplied-server/0237-Max-joins-per-second.patch +++ b/patches/server/0233-Max-joins-per-second.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Max joins per second When this option is set to true the `max-joins-per-tick` setting in paper.yml will be used per second instead of per tick diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java -index a536ebcf29d8ef0ed32863bd8d5e70f7a0636e8d..9e31954212b1d6162dca2fbc91d373e908560335 100644 +index 58d28b6c1cc7da7d786f78308db971f7502ad844..9f274048be29ed54dd91983447beadf076cf7438 100644 --- a/src/main/java/net/minecraft/network/Connection.java +++ b/src/main/java/net/minecraft/network/Connection.java -@@ -570,11 +570,20 @@ public class Connection extends SimpleChannelInboundHandler> { +@@ -607,11 +607,20 @@ public class Connection extends SimpleChannelInboundHandler> { private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper - Buffer joins to world private static int joinAttemptsThisTick; // Paper - Buffer joins to world private static int currTick; // Paper - Buffer joins to world @@ -31,7 +31,7 @@ index a536ebcf29d8ef0ed32863bd8d5e70f7a0636e8d..9e31954212b1d6162dca2fbc91d373e9 } // Paper end - Buffer joins to world diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index ce3ab604e6ed6669f38abf83d40b500148277b9d..a05da9ff158c6e7d55abb23e4b28f3703e9e5b3d 100644 +index 2d32b5aaa2b2f33b773f9157aee4f7461c48147a..42a916e89b838868967391b9c042ce5143d862d0 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -456,8 +456,10 @@ public class PurpurConfig { diff --git a/patches/unapplied-server/0238-Configurable-minimum-demand-for-trades.patch b/patches/server/0234-Configurable-minimum-demand-for-trades.patch similarity index 91% rename from patches/unapplied-server/0238-Configurable-minimum-demand-for-trades.patch rename to patches/server/0234-Configurable-minimum-demand-for-trades.patch index d5d59822b..23d1a98f8 100644 --- a/patches/unapplied-server/0238-Configurable-minimum-demand-for-trades.patch +++ b/patches/server/0234-Configurable-minimum-demand-for-trades.patch @@ -9,10 +9,10 @@ This patch adds a config option to allow the minimum demand to instead be configurable. diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index 19a3e88ce5ccdd74b049246eb51eaa0783d03d5d..79184e4721236d4d30f9c516ac0efb56cf06af7d 100644 +index 17a247455dd853ae98e2f82f64a99bccc4d27438..4fa66af33ede3949f4e0236c806e3373f9dea730 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -547,7 +547,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -545,7 +545,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler while (iterator.hasNext()) { MerchantOffer merchantrecipe = (MerchantOffer) iterator.next(); @@ -22,10 +22,10 @@ index 19a3e88ce5ccdd74b049246eb51eaa0783d03d5d..79184e4721236d4d30f9c516ac0efb56 } diff --git a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java -index 02feea12c998f37098b72becf6bfaf6b27d155de..9c89a85d934955c9388cfe1361f13e70e699d279 100644 +index 0efc8d997b34302c3e0a5d7ec73a11a940dbeefe..af157881d440b34cfe79fbc9b03cc9ef28515eb8 100644 --- a/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java +++ b/src/main/java/net/minecraft/world/item/trading/MerchantOffer.java -@@ -149,7 +149,12 @@ public class MerchantOffer { +@@ -131,7 +131,12 @@ public class MerchantOffer { } public void updateDemand() { diff --git a/patches/unapplied-server/0239-Lobotomize-stuck-villagers.patch b/patches/server/0235-Lobotomize-stuck-villagers.patch similarity index 91% rename from patches/unapplied-server/0239-Lobotomize-stuck-villagers.patch rename to patches/server/0235-Lobotomize-stuck-villagers.patch index ee9f2fb36..6b9c00960 100644 --- a/patches/unapplied-server/0239-Lobotomize-stuck-villagers.patch +++ b/patches/server/0235-Lobotomize-stuck-villagers.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Lobotomize stuck villagers diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index 79184e4721236d4d30f9c516ac0efb56cf06af7d..a188a36d919037fa3177ad7f6930570f5e130fc9 100644 +index 4fa66af33ede3949f4e0236c806e3373f9dea730..dd74825c04543ae8c0bb1ab5eef6c8a152b621fd 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -142,6 +142,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @@ -15,9 +15,9 @@ index 79184e4721236d4d30f9c516ac0efb56cf06af7d..a188a36d919037fa3177ad7f6930570f + private boolean isLobotomized = false; public boolean isLobotomized() { return this.isLobotomized; } // Purpur + private int notLobotomizedCount = 0; // Purpur - public long nextGolemPanic = -1; // Pufferfish - -@@ -201,6 +203,48 @@ public class Villager extends AbstractVillager implements ReputationEventHandler + public Villager(EntityType entityType, Level world) { + this(entityType, world, VillagerType.PLAINS); +@@ -199,6 +201,48 @@ public class Villager extends AbstractVillager implements ReputationEventHandler return this.level().purpurConfig.villagerAlwaysDropExp; } @@ -66,7 +66,7 @@ index 79184e4721236d4d30f9c516ac0efb56cf06af7d..a188a36d919037fa3177ad7f6930570f @Override public Brain getBrain() { return (Brain) super.getBrain(); // CraftBukkit - decompile error -@@ -298,13 +342,19 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -295,10 +339,19 @@ public class Villager extends AbstractVillager implements ReputationEventHandler // Paper start this.customServerAiStep(false); } @@ -74,20 +74,19 @@ index 79184e4721236d4d30f9c516ac0efb56cf06af7d..a188a36d919037fa3177ad7f6930570f + protected void customServerAiStep(boolean inactive) { // Purpur - not final // Paper end this.level().getProfiler().push("villagerBrain"); - // Purpur start ++ // Purpur start + if (this.level().purpurConfig.villagerLobotomizeEnabled) { + // treat as inactive if lobotomized + inactive = inactive || checkLobotomized(); + } else { + this.isLobotomized = false; + } ++ // Purpur end + if (!inactive) this.getBrain().tick((ServerLevel) this.level(), this); // Paper ++ else if (this.isLobotomized && shouldRestock()) restock(); // Purpur + /*// Purpur start // Purpur - TODO: Pufferfish if (!inactive && (getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) { // Purpur - only use brain if no rider this.getBrain().tick((ServerLevel) this.level(), this); // Paper -- } -+ } else if (this.isLobotomized && shouldRestock()) restock(); - // Purpur end - this.level().getProfiler().pop(); - if (this.assignProfessionWhenSpawned) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java index 6c15d40979fd3e3d246a447c432b321fbf29ada3..6ace76a829c88e2e747dbbcce0a6582c615fc56d 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java diff --git a/patches/unapplied-server/0240-Option-for-villager-display-trade-item.patch b/patches/server/0236-Option-for-villager-display-trade-item.patch similarity index 100% rename from patches/unapplied-server/0240-Option-for-villager-display-trade-item.patch rename to patches/server/0236-Option-for-villager-display-trade-item.patch diff --git a/patches/unapplied-server/0241-MC-238526-Fix-spawner-not-spawning-water-animals-cor.patch b/patches/server/0237-MC-238526-Fix-spawner-not-spawning-water-animals-cor.patch similarity index 92% rename from patches/unapplied-server/0241-MC-238526-Fix-spawner-not-spawning-water-animals-cor.patch rename to patches/server/0237-MC-238526-Fix-spawner-not-spawning-water-animals-cor.patch index 0b5fcda87..a5a8a6c5c 100644 --- a/patches/unapplied-server/0241-MC-238526-Fix-spawner-not-spawning-water-animals-cor.patch +++ b/patches/server/0237-MC-238526-Fix-spawner-not-spawning-water-animals-cor.patch @@ -5,10 +5,10 @@ Subject: [PATCH] MC-238526 - Fix spawner not spawning water animals correctly diff --git a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java -index 75884a9e69a28404752c1a2cf854335bb78cac01..1fd69e6ab765236b1a09e2791188d1eb7f12ecbb 100644 +index 6f22705072fecbe91196e4966fca2eeec060f120..ed2ae44f7cef5aed17d10cc8a7df0a2276f9f16b 100644 --- a/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java +++ b/src/main/java/net/minecraft/world/entity/animal/WaterAnimal.java -@@ -78,6 +78,6 @@ public abstract class WaterAnimal extends PathfinderMob { +@@ -72,6 +72,6 @@ public abstract class WaterAnimal extends PathfinderMob { i = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.maximum.or(i); j = world.getMinecraftWorld().paperConfig().entities.spawning.wateranimalSpawnHeight.minimum.or(j); // Paper end - Make water animal spawn height configurable diff --git a/patches/unapplied-server/0242-Config-for-mob-last-hurt-by-player-time.patch b/patches/server/0238-Config-for-mob-last-hurt-by-player-time.patch similarity index 92% rename from patches/unapplied-server/0242-Config-for-mob-last-hurt-by-player-time.patch rename to patches/server/0238-Config-for-mob-last-hurt-by-player-time.patch index 6fa467d46..eb993307e 100644 --- a/patches/unapplied-server/0242-Config-for-mob-last-hurt-by-player-time.patch +++ b/patches/server/0238-Config-for-mob-last-hurt-by-player-time.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Config for mob last hurt by player time diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 21019c1484a281e6cbcaf1c3e462efa106fee5eb..839f280eeb18e01712a18b595b1a13abfab6f45b 100644 +index bfb9d3c92950b2600320ba3af409acbf810b5fe7..484eff80394a55088f3cef726a8263e28accd6fe 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java -@@ -1555,13 +1555,13 @@ public abstract class LivingEntity extends Entity implements Attackable { +@@ -1561,13 +1561,13 @@ public abstract class LivingEntity extends Entity implements Attackable { if (entity1 instanceof net.minecraft.world.entity.player.Player) { net.minecraft.world.entity.player.Player entityhuman = (net.minecraft.world.entity.player.Player) entity1; @@ -25,10 +25,10 @@ index 21019c1484a281e6cbcaf1c3e462efa106fee5eb..839f280eeb18e01712a18b595b1a13ab if (entityliving2 instanceof net.minecraft.world.entity.player.Player) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -index 210040aa3f810c03cadf38df9d10da336dffaaa1..64c73cc7370c23c9ce68b68476fd0ddb3ca6beca 100644 +index d08f86f2122441d661e7693ad7dcb9854921a767..8d83832ef4bdc452c944101985c4b61cfcef0f08 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java -@@ -506,7 +506,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { +@@ -505,7 +505,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { net.minecraft.server.level.ServerPlayer entityPlayer = killer == null ? null : ((CraftPlayer) killer).getHandle(); getHandle().lastHurtByPlayer = entityPlayer; getHandle().lastHurtByMob = entityPlayer; diff --git a/patches/unapplied-server/0243-Anvil-repair-damage-options.patch b/patches/server/0239-Anvil-repair-damage-options.patch similarity index 94% rename from patches/unapplied-server/0243-Anvil-repair-damage-options.patch rename to patches/server/0239-Anvil-repair-damage-options.patch index 1b5dc7e93..e1c39b8fd 100644 --- a/patches/unapplied-server/0243-Anvil-repair-damage-options.patch +++ b/patches/server/0239-Anvil-repair-damage-options.patch @@ -5,13 +5,13 @@ Subject: [PATCH] Anvil repair/damage options diff --git a/src/main/java/net/minecraft/world/level/block/AnvilBlock.java b/src/main/java/net/minecraft/world/level/block/AnvilBlock.java -index 18d2ff1baa2db0b97f2565eac006fbc4e81022fa..58d29c89e8e54fac143982c40c9aecc855b6cfd5 100644 +index 923357251ad950ec4f893e8771fcfa99de8a60c5..9273db1b30398b3d170df562dfeff040c2b14a92 100644 --- a/src/main/java/net/minecraft/world/level/block/AnvilBlock.java +++ b/src/main/java/net/minecraft/world/level/block/AnvilBlock.java -@@ -62,6 +62,54 @@ public class AnvilBlock extends FallingBlock { +@@ -61,6 +61,54 @@ public class AnvilBlock extends FallingBlock { @Override - public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) { + protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) { + // Purpur start - repairable/damageable anvils + if (world.purpurConfig.anvilRepairIngotsAmount > 0) { + net.minecraft.world.item.ItemStack itemstack = player.getItemInHand(hand); diff --git a/patches/unapplied-server/0244-Option-to-disable-turtle-egg-trampling-with-feather-.patch b/patches/server/0240-Option-to-disable-turtle-egg-trampling-with-feather-.patch similarity index 94% rename from patches/unapplied-server/0244-Option-to-disable-turtle-egg-trampling-with-feather-.patch rename to patches/server/0240-Option-to-disable-turtle-egg-trampling-with-feather-.patch index 5b8fbc7b1..4a6e93a01 100644 --- a/patches/unapplied-server/0244-Option-to-disable-turtle-egg-trampling-with-feather-.patch +++ b/patches/server/0240-Option-to-disable-turtle-egg-trampling-with-feather-.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Option to disable turtle egg trampling with feather falling diff --git a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java -index b18545e1bd55fa468af6d6c03211036eb9fa146d..9a76665c6369b4106d152370dc3d2f5645cb02b1 100644 +index 2f0e8aeb9c45853fca12ddd78a7d51813a600e67..c3df410f692219ef166a8b885980b23a2c79950d 100644 --- a/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java +++ b/src/main/java/net/minecraft/world/level/block/TurtleEggBlock.java -@@ -218,7 +218,13 @@ public class TurtleEggBlock extends Block { +@@ -219,7 +219,13 @@ public class TurtleEggBlock extends Block { if (!(entity instanceof LivingEntity)) { return false; } diff --git a/patches/unapplied-server/0245-Add-toggle-for-enchant-level-clamping.patch b/patches/server/0241-Add-toggle-for-enchant-level-clamping.patch similarity index 65% rename from patches/unapplied-server/0245-Add-toggle-for-enchant-level-clamping.patch rename to patches/server/0241-Add-toggle-for-enchant-level-clamping.patch index ab2a68da0..ffd326d92 100644 --- a/patches/unapplied-server/0245-Add-toggle-for-enchant-level-clamping.patch +++ b/patches/server/0241-Add-toggle-for-enchant-level-clamping.patch @@ -5,33 +5,31 @@ Subject: [PATCH] Add toggle for enchant level clamping diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index 829d84f48c7149ec1ba0b71b0f43ef19fed99380..f6664447c45b1d6f3371af7bed8b1175b17f25e2 100644 +index 0bc6edf82d77ae88d64bd6ca0a5294c2143f2f5c..53fc44af2b9ceca0abb6c7b287eb08bdd1bf7fdb 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java -@@ -1235,7 +1235,7 @@ public final class ItemStack { +@@ -1220,6 +1220,7 @@ public final class ItemStack implements DataComponentHolder { - ListTag nbttaglist = this.tag.getList("Enchantments", 10); - -- nbttaglist.add(EnchantmentHelper.storeEnchantment(EnchantmentHelper.getEnchantmentId(enchantment), (byte) level)); -+ nbttaglist.add(EnchantmentHelper.storeEnchantment(EnchantmentHelper.getEnchantmentId(enchantment), (org.purpurmc.purpur.PurpurConfig.clampEnchantLevels) ? (byte) level : (short) level)); // Purpur - processEnchantOrder(this.tag); // Paper + public void enchant(Enchantment enchantment, int level) { + EnchantmentHelper.updateEnchantments(this, (itemenchantments_a) -> { ++ //org.purpurmc.purpur.PurpurConfig.clampEnchantLevels // Purpur - TODO: fix clamp enchant levels option + itemenchantments_a.upgrade(enchantment, level); + }); } - diff --git a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java -index 496c47eb3b13ba620fde1a2bc96f886c5b01e1de..06ca2cd5ae2a25205a37c783753ef7d56e72df94 100644 +index 6d0363cec691996be416ab22ef9d825196399158..96a402b8c5bf083c6120950eacf7970226972b8b 100644 --- a/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java +++ b/src/main/java/net/minecraft/world/item/enchantment/EnchantmentHelper.java -@@ -47,7 +47,7 @@ public class EnchantmentHelper { - } +@@ -35,6 +35,7 @@ public class EnchantmentHelper { - public static int getEnchantmentLevel(CompoundTag nbt) { -- return Mth.clamp(nbt.getInt("lvl"), 0, 255); -+ return Mth.clamp(nbt.getInt("lvl"), 0, (org.purpurmc.purpur.PurpurConfig.clampEnchantLevels) ? 255 : 32767); // Purpur + public static int getItemEnchantmentLevel(Enchantment enchantment, ItemStack stack) { + ItemEnchantments itemEnchantments = stack.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY); ++ //org.purpurmc.purpur.PurpurConfig.clampEnchantLevels // Purpur - TODO: fix clamp enchant levels option + return itemEnchantments.getLevel(enchantment); } - @Nullable diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index a05da9ff158c6e7d55abb23e4b28f3703e9e5b3d..a504f727f5aaa605809938b4e7e7bbe9b84c522a 100644 +index 42a916e89b838868967391b9c042ce5143d862d0..af79332c9c54ca314c59c6e503478e52c5970e31 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -398,6 +398,7 @@ public class PurpurConfig { diff --git a/patches/unapplied-server/0246-Skip-junit-tests-for-purpur-commands.patch b/patches/server/0242-Skip-junit-tests-for-purpur-commands.patch similarity index 80% rename from patches/unapplied-server/0246-Skip-junit-tests-for-purpur-commands.patch rename to patches/server/0242-Skip-junit-tests-for-purpur-commands.patch index bd9cfd575..d8c96ae4a 100644 --- a/patches/unapplied-server/0246-Skip-junit-tests-for-purpur-commands.patch +++ b/patches/server/0242-Skip-junit-tests-for-purpur-commands.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Skip junit tests for purpur commands diff --git a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java -index afeb4271fffb7546209f1e651214065187c88302..81bc3af856b8af019fd13e1da1f7cccd526b7cf0 100644 +index 2f3ff50bf3f70b6b404d02d5ffcc079162a63bc1..4e57fdf21d4b7789cd7c3d3a18ddc6227bc77792 100644 --- a/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java +++ b/src/test/java/io/papermc/paper/permissions/MinecraftCommandPermissionsTest.java -@@ -45,6 +45,7 @@ public class MinecraftCommandPermissionsTest extends AbstractTestingBase { - Set foundPerms = new HashSet<>(); - for (CommandNode child : root.getChildren()) { - final String vanillaPerm = VanillaCommandWrapper.getPermission(child); +@@ -48,6 +48,7 @@ public class MinecraftCommandPermissionsTest extends AbstractTestingBase { + if ("bukkit.command.paper.pgive".equals(vanillaPerm)) { // skip our custom give command + continue; + } + if (TO_SKIP.contains(vanillaPerm)) continue; // Purpur if (!perms.contains(vanillaPerm)) { missing.add("Missing permission for " + child.getName() + " (" + vanillaPerm + ") command"); } else { -@@ -57,6 +58,25 @@ public class MinecraftCommandPermissionsTest extends AbstractTestingBase { +@@ -60,6 +61,25 @@ public class MinecraftCommandPermissionsTest extends AbstractTestingBase { } private static final List TO_SKIP = List.of( diff --git a/patches/unapplied-server/0247-Implement-configurable-search-radius-for-villagers-t.patch b/patches/server/0243-Implement-configurable-search-radius-for-villagers-t.patch similarity index 94% rename from patches/unapplied-server/0247-Implement-configurable-search-radius-for-villagers-t.patch rename to patches/server/0243-Implement-configurable-search-radius-for-villagers-t.patch index 314a30caf..c96696d3e 100644 --- a/patches/unapplied-server/0247-Implement-configurable-search-radius-for-villagers-t.patch +++ b/patches/server/0243-Implement-configurable-search-radius-for-villagers-t.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Implement configurable search radius for villagers to spawn diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java -index a188a36d919037fa3177ad7f6930570f5e130fc9..ef7c67f591ca4a3c73b87a7c44b37ad0b51d875c 100644 +index dd74825c04543ae8c0bb1ab5eef6c8a152b621fd..dcf580d852ede8ea01f5d91944a224ec6eca73e4 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java -@@ -1102,6 +1102,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler +@@ -1095,6 +1095,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler } public void spawnGolemIfNeeded(ServerLevel world, long time, int requiredCount) { diff --git a/patches/unapplied-server/0248-Stonecutter-damage.patch b/patches/server/0244-Stonecutter-damage.patch similarity index 80% rename from patches/unapplied-server/0248-Stonecutter-damage.patch rename to patches/server/0244-Stonecutter-damage.patch index 6d36c0321..4232be417 100644 --- a/patches/unapplied-server/0248-Stonecutter-damage.patch +++ b/patches/server/0244-Stonecutter-damage.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Stonecutter damage diff --git a/src/main/java/net/minecraft/world/damagesource/CombatTracker.java b/src/main/java/net/minecraft/world/damagesource/CombatTracker.java -index d8c5fb5432f0b09124d7f4dbc7b50859c1a84cc7..925654e40a170d1a4af0b9fcde1b9b359f833064 100644 +index a375d40ec6365ba8704ba3ece22dd5b2de9857b5..357a79d72a2de02a019595e457fe432bf409e516 100644 --- a/src/main/java/net/minecraft/world/damagesource/CombatTracker.java +++ b/src/main/java/net/minecraft/world/damagesource/CombatTracker.java -@@ -100,6 +100,8 @@ public class CombatTracker { +@@ -101,6 +101,8 @@ public class CombatTracker { // Purpur start if (damageSource.isScissors()) { return damageSource.getLocalizedDeathMessage(org.purpurmc.purpur.PurpurConfig.deathMsgRunWithScissors, this.mob); @@ -18,10 +18,10 @@ index d8c5fb5432f0b09124d7f4dbc7b50859c1a84cc7..925654e40a170d1a4af0b9fcde1b9b35 // Purpur end return damageSource.getLocalizedDeathMessage(this.mob); diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -index 5cbbff174b6f10bebe1923c10f84fc26e4d3000e..41651c877246f38c73cc9c81b37a0b86e5054cb9 100644 +index 9c18134cb5474a7f3be2337036c7af253ec0b21e..b6881d7f02ad4e9e45e947eaec54f0c6b8ff957a 100644 --- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java +++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java -@@ -28,6 +28,7 @@ public class DamageSource { +@@ -29,6 +29,7 @@ public class DamageSource { private boolean melting = false; private boolean poison = false; private boolean scissors = false; // Purpur @@ -29,7 +29,7 @@ index 5cbbff174b6f10bebe1923c10f84fc26e4d3000e..41651c877246f38c73cc9c81b37a0b86 @Nullable private Entity customEventDamager = null; // This field is a helper for when causing entity damage is not set by vanilla // Paper - fix DamageSource API -@@ -67,6 +68,15 @@ public class DamageSource { +@@ -68,6 +69,15 @@ public class DamageSource { public boolean isScissors() { return this.scissors; } @@ -45,7 +45,7 @@ index 5cbbff174b6f10bebe1923c10f84fc26e4d3000e..41651c877246f38c73cc9c81b37a0b86 // Purpur end // Paper start - fix DamageSource API -@@ -113,6 +123,7 @@ public class DamageSource { +@@ -114,6 +124,7 @@ public class DamageSource { damageSource.poison = this.isPoison(); damageSource.melting = this.isMelting(); damageSource.scissors = this.isScissors(); // Purpur @@ -54,7 +54,7 @@ index 5cbbff174b6f10bebe1923c10f84fc26e4d3000e..41651c877246f38c73cc9c81b37a0b86 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSources.java b/src/main/java/net/minecraft/world/damagesource/DamageSources.java -index 23c7f22dacc570837120c28e0a57f8c9155e92fc..2c1fdc031bcfc8f39692312e9ce9c5a3cf987349 100644 +index b3d7790fa3e873f2e9b8fa4e4e749ef9c06973b9..e8c0cec909deea5cd9a031856d9d249f85d5e5f7 100644 --- a/src/main/java/net/minecraft/world/damagesource/DamageSources.java +++ b/src/main/java/net/minecraft/world/damagesource/DamageSources.java @@ -45,12 +45,14 @@ public class DamageSources { @@ -83,11 +83,11 @@ index 23c7f22dacc570837120c28e0a57f8c9155e92fc..2c1fdc031bcfc8f39692312e9ce9c5a3 public DamageSource inFire() { diff --git a/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java b/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java -index 7c41b940dd915a27856f6fa6f9e536e296deeb53..51ba321172acc9908aac456f8209dd6af6987aa8 100644 +index c6ecb378d0cb2ac05b8f22f92fb85df060038f77..b0199a8ffb1ea4cafeadedb8b833063db177b3cd 100644 --- a/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java +++ b/src/main/java/net/minecraft/world/level/block/StonecutterBlock.java -@@ -99,4 +99,14 @@ public class StonecutterBlock extends Block { - public boolean isPathfindable(BlockState state, BlockGetter world, BlockPos pos, PathComputationType type) { +@@ -98,4 +98,14 @@ public class StonecutterBlock extends Block { + protected boolean isPathfindable(BlockState state, PathComputationType type) { return false; } + @@ -102,32 +102,23 @@ index 7c41b940dd915a27856f6fa6f9e536e296deeb53..51ba321172acc9908aac456f8209dd6a + // Purpur end } diff --git a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java -index b7f9793900d365f91d6e30dd22881a30e4250ac8..a0527e9f9c84353d2f4e56bf2f5341fd99daad94 100644 +index 31ae0f466ae522d767907ec5066b26695f327b96..f26383cf896785333dbd6f86348d5a5f67a6731f 100644 --- a/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java +++ b/src/main/java/net/minecraft/world/level/pathfinder/WalkNodeEvaluator.java -@@ -475,7 +475,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { - return BlockPathTypes.BLOCKED; - } else { - // Paper end - Do not load chunks during pathfinding -- if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH)) { -+ if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH) || blockState.is(Blocks.STONECUTTER)) { // Purpur - return BlockPathTypes.DANGER_OTHER; - } - -@@ -509,7 +509,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { - return BlockPathTypes.TRAPDOOR; +@@ -491,7 +491,7 @@ public class WalkNodeEvaluator extends NodeEvaluator { + return PathType.TRAPDOOR; } else if (blockState.is(Blocks.POWDER_SNOW)) { - return BlockPathTypes.POWDER_SNOW; + return PathType.POWDER_SNOW; - } else if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH)) { + } else if (blockState.is(Blocks.CACTUS) || blockState.is(Blocks.SWEET_BERRY_BUSH) || blockState.is(Blocks.STONECUTTER)) { // Purpur - return BlockPathTypes.DAMAGE_OTHER; + return PathType.DAMAGE_OTHER; } else if (blockState.is(Blocks.HONEY_BLOCK)) { - return BlockPathTypes.STICKY_HONEY; + return PathType.STICKY_HONEY; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 171efb1ab482d0042bead18df0880f038cfda16a..b82a6143526bd1d4ecd4591c1253cdb0b913fe09 100644 +index 2391a0c59bfbf315f00ce41c5e0a03ea23a25448..1bd373d835cfcf1b43b28dbd0f138facb06f76f9 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1133,7 +1133,7 @@ public class CraftEventFactory { +@@ -1130,7 +1130,7 @@ public class CraftEventFactory { return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), entity, DamageCause.LAVA, bukkitDamageSource, modifiers, modifierFunctions, cancelled); } else if (source.getDirectBlock() != null) { DamageCause cause; @@ -137,7 +128,7 @@ index 171efb1ab482d0042bead18df0880f038cfda16a..b82a6143526bd1d4ecd4591c1253cdb0 } else if (source.is(DamageTypes.HOT_FLOOR)) { cause = DamageCause.HOT_FLOOR; diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java -index a504f727f5aaa605809938b4e7e7bbe9b84c522a..9bc5cc4944dcd3918b2a90bde9dd8fdd795ae3b2 100644 +index af79332c9c54ca314c59c6e503478e52c5970e31..07d6455c781b8743a833cbc04576015433686c4b 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java @@ -209,8 +209,10 @@ public class PurpurConfig { diff --git a/patches/unapplied-server/0249-Configurable-damage-settings-for-magma-blocks.patch b/patches/server/0245-Configurable-damage-settings-for-magma-blocks.patch similarity index 96% rename from patches/unapplied-server/0249-Configurable-damage-settings-for-magma-blocks.patch rename to patches/server/0245-Configurable-damage-settings-for-magma-blocks.patch index 7b733c49e..12d624dac 100644 --- a/patches/unapplied-server/0249-Configurable-damage-settings-for-magma-blocks.patch +++ b/patches/server/0245-Configurable-damage-settings-for-magma-blocks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Configurable damage settings for magma blocks diff --git a/src/main/java/net/minecraft/world/level/block/MagmaBlock.java b/src/main/java/net/minecraft/world/level/block/MagmaBlock.java -index 746c211b575ca588deadbbcd5c55b614e8660ba8..2f38bac9efc224084505e802546623260830b6d4 100644 +index 77bbdc15472d656fd40e841a70e34d3d31580819..55ae530fac54236ea5614f8e92c30febc744f179 100644 --- a/src/main/java/net/minecraft/world/level/block/MagmaBlock.java +++ b/src/main/java/net/minecraft/world/level/block/MagmaBlock.java @@ -29,7 +29,7 @@ public class MagmaBlock extends Block { diff --git a/patches/unapplied-server/0250-Add-config-for-snow-on-blue-ice.patch b/patches/server/0246-Add-config-for-snow-on-blue-ice.patch similarity index 91% rename from patches/unapplied-server/0250-Add-config-for-snow-on-blue-ice.patch rename to patches/server/0246-Add-config-for-snow-on-blue-ice.patch index 7847c74cd..9c19930b3 100644 --- a/patches/unapplied-server/0250-Add-config-for-snow-on-blue-ice.patch +++ b/patches/server/0246-Add-config-for-snow-on-blue-ice.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Add config for snow on blue ice diff --git a/src/main/java/net/minecraft/world/level/block/SnowLayerBlock.java b/src/main/java/net/minecraft/world/level/block/SnowLayerBlock.java -index a3da9536c3a3ad33d1c795673bdd7b05d6534054..9b057f3967aae5d0ca621b19d1212db91aaaee22 100644 +index 93e8e5107ac047c1f2579b4fe6b0a202edb695f6..f82d275aac7bf3949d3dcc412c7e39e115c69458 100644 --- a/src/main/java/net/minecraft/world/level/block/SnowLayerBlock.java +++ b/src/main/java/net/minecraft/world/level/block/SnowLayerBlock.java @@ -88,6 +88,12 @@ public class SnowLayerBlock extends Block { - public boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { + protected boolean canSurvive(BlockState state, LevelReader world, BlockPos pos) { BlockState iblockdata1 = world.getBlockState(pos.below()); + // Purpur start