From cb54a09d9d898d7194be30d66c813a3701074e07 Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Sun, 11 Aug 2024 18:21:21 +0800 Subject: [PATCH] Updated Upstream (Paper/Gale/Purpur/Leaves) Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@042f15f [ci skip] chore: fix incorrect commit hash in PR builds (#11198) PaperMC/Paper@4e6a2a1 Check for block type in SculkSensorBlock#canActivate PaperMC/Paper@77a5779 Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11197) PaperMC/Paper@4d7cef3 Fix source of knockback for spigot events (#11176) PaperMC/Paper@b1b5d4c Check shooter in configurable projectile relative velocity patch Gale Changes: Dreeam-qwq/Gale@33fb580 Updated Upstream (Paper) Dreeam-qwq/Gale@3a5ff70 Updated Upstream (Paper) Purpur Changes: PurpurMC/Purpur@7950960 Updated Upstream (Paper) PurpurMC/Purpur@73a90e8 Updated Upstream (Paper) PurpurMC/Purpur@75e81d8 deprecate old anvil api methods PurpurMC/Purpur@4e55e26 final 1.21 Paper upstream Leaves Changes: LeavesMC/Leaves@26e31ff Update fakeplayer, and fix #298 LeavesMC/Leaves@af01380 And make #297 happy LeavesMC/Leaves@1782bd4 [ci-skip] Serve immediately (#295) --- gradle.properties | 2 +- patches/api/0004-Purpur-API-Changes.patch | 73 +++++++++- .../0001-Purpur-generated-api-Changes.patch | 2 +- patches/server/0004-Leaf-Bootstrap.patch | 4 +- .../server/0011-Purpur-Server-Changes.patch | 134 ++++++++++++------ patches/server/0030-Leaves-Server-Utils.patch | 2 +- ...m-in-BlockBehaviour-cache-blockstate.patch | 6 +- 7 files changed, 169 insertions(+), 54 deletions(-) diff --git a/gradle.properties b/gradle.properties index 2fec22afb..72176e173 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ group = cn.dreeam.leaf mcVersion = 1.21 version = 1.21-R0.1-SNAPSHOT -galeCommit = 725b95a886e5e0998c5db7b12414147392572276 +galeCommit = 3a5ff7002573845a0684c05efc820bafd9a76d55 org.gradle.caching = true org.gradle.parallel = true diff --git a/patches/api/0004-Purpur-API-Changes.patch b/patches/api/0004-Purpur-API-Changes.patch index 613c933e6..12ff78666 100644 --- a/patches/api/0004-Purpur-API-Changes.patch +++ b/patches/api/0004-Purpur-API-Changes.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Purpur API Changes Original license: MIT Original project: https://github.com/PurpurMC/Purpur -Commit: 930003b1d1826c083f3cee4db79621e6a7d726f1 +Commit: 4e55e26f4dcd046f68c977b6348ad3ae265aa896 Patches below are removed in this patch: Pufferfish-API-Changes.patch @@ -1221,21 +1221,49 @@ index 398f74ba0d2e890fb556cd964f61da7c623a7c6d..29090acd16d8f5a41c8653d0e68692f0 private final boolean isCreatable; diff --git a/src/main/java/org/bukkit/inventory/AnvilInventory.java b/src/main/java/org/bukkit/inventory/AnvilInventory.java -index c60be4fd24c7fdf65251dd6169e5e1ac3b588d95..569deccd2f1cf21da9b5906433ac493c1f2081be 100644 +index f1f97a85ec713c05c882d7588f4a3e4a017f4795..813f6cd253322538bdf96eb323dd23a7809a1c1e 100644 --- a/src/main/java/org/bukkit/inventory/AnvilInventory.java +++ b/src/main/java/org/bukkit/inventory/AnvilInventory.java -@@ -123,4 +123,14 @@ public interface AnvilInventory extends Inventory { +@@ -138,4 +138,42 @@ public interface AnvilInventory extends Inventory { setItem(2, result); } // Paper end + + // Purpur start ++ /** ++ * Gets if the player viewing the anvil inventory can bypass experience cost ++ * ++ * @return whether the player viewing the anvil inventory can bypass the experience cost ++ * @deprecated use {@link AnvilView#canBypassCost()}. ++ */ ++ @Deprecated(forRemoval = true, since = "1.21") + boolean canBypassCost(); + ++ /** ++ * Set if the player viewing the anvil inventory can bypass the experience cost ++ * ++ * @param bypassCost whether the player viewing the anvil inventory can bypass the experience cost ++ * @deprecated use {@link AnvilView#setBypassCost(boolean)}. ++ */ ++ @Deprecated(forRemoval = true, since = "1.21") + void setBypassCost(boolean bypassCost); + ++ /** ++ * Gets if the player viewing the anvil inventory can do unsafe enchants ++ * ++ * @return whether the player viewing the anvil inventory can do unsafe enchants ++ * @deprecated use {@link AnvilView#canDoUnsafeEnchants()}. ++ */ ++ @Deprecated(forRemoval = true, since = "1.21") + boolean canDoUnsafeEnchants(); + ++ /** ++ * Set if the player viewing the anvil inventory can do unsafe enchants ++ * ++ * @param canDoUnsafeEnchants whether the player viewing the anvil inventory can do unsafe enchants ++ * @deprecated use {@link AnvilView#setDoUnsafeEnchants(boolean)}. ++ */ ++ @Deprecated(forRemoval = true, since = "1.21") + void setDoUnsafeEnchants(boolean canDoUnsafeEnchants); + // Purpur end } @@ -1851,6 +1879,45 @@ index e7796054f3f65f5bea7f93c75320195f6c2f0561..1b1d05b77e93abe93ed782883f8d791f @Override public int hashCode() { int hash = 7; +diff --git a/src/main/java/org/bukkit/inventory/view/AnvilView.java b/src/main/java/org/bukkit/inventory/view/AnvilView.java +index 0344b3db789baf1da0b59f2d2cd66154b69b38a9..4b130327c84b05938d21d563f78361f9483a6a4e 100644 +--- a/src/main/java/org/bukkit/inventory/view/AnvilView.java ++++ b/src/main/java/org/bukkit/inventory/view/AnvilView.java +@@ -59,4 +59,34 @@ public interface AnvilView extends InventoryView { + * @param levels the levels to set + */ + void setMaximumRepairCost(int levels); ++ ++ // Purpur start ++ /** ++ * Gets if the player viewing the anvil inventory can bypass experience cost ++ * ++ * @return whether the player viewing the anvil inventory can bypass the experience cost ++ */ ++ boolean canBypassCost(); ++ ++ /** ++ * Set if the player viewing the anvil inventory can bypass the experience cost ++ * ++ * @param bypassCost whether the player viewing the anvil inventory can bypass the experience cost ++ */ ++ void setBypassCost(boolean bypassCost); ++ ++ /** ++ * Gets if the player viewing the anvil inventory can do unsafe enchants ++ * ++ * @return whether the player viewing the anvil inventory can do unsafe enchants ++ */ ++ boolean canDoUnsafeEnchants(); ++ ++ /** ++ * Set if the player viewing the anvil inventory can do unsafe enchants ++ * ++ * @param canDoUnsafeEnchants whether the player viewing the anvil inventory can do unsafe enchants ++ */ ++ void setDoUnsafeEnchants(boolean canDoUnsafeEnchants); ++ // Purpur end + } diff --git a/src/main/java/org/bukkit/map/MapRenderer.java b/src/main/java/org/bukkit/map/MapRenderer.java index cb7040876a99a5a7e49b81684ef0f3b79584c376..22d8f31b1b8a5dbb5ab3275068642937c097abfe 100644 --- a/src/main/java/org/bukkit/map/MapRenderer.java diff --git a/patches/generated-api/0001-Purpur-generated-api-Changes.patch b/patches/generated-api/0001-Purpur-generated-api-Changes.patch index 385f74980..98560607c 100644 --- a/patches/generated-api/0001-Purpur-generated-api-Changes.patch +++ b/patches/generated-api/0001-Purpur-generated-api-Changes.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Purpur generated-api Changes Original license: MIT Original project: https://github.com/PurpurMC/Purpur -Commit: 930003b1d1826c083f3cee4db79621e6a7d726f1 +Commit: 4e55e26f4dcd046f68c977b6348ad3ae265aa896 diff --git a/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/com/destroystokyo/paper/entity/ai/VanillaGoal.java index 3add91218dd3f07052aa932f0503d1f10ac3799b..3e41a4141095bce989c75e989293deb3f47e8e6d 100644 diff --git a/patches/server/0004-Leaf-Bootstrap.patch b/patches/server/0004-Leaf-Bootstrap.patch index c1a9bcaa9..01c3c6e0f 100644 --- a/patches/server/0004-Leaf-Bootstrap.patch +++ b/patches/server/0004-Leaf-Bootstrap.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Leaf Bootstrap org.bukkit.craftbukkit.Main#main -> LeafBootstrap -> PaperBootstrap -> ... diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 618f4b2e1d012b647b3e7bf359c8ecdd7f159e63..e45a2a0c9e461486d3a70f75630ffbc7443ce04e 100644 +index c1e88c31910e96ef07cece05046c0b55e708b52d..c63dfc0b740ce2e544ad920188d7d7dfc2ae3e04 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java -@@ -284,7 +284,8 @@ public class Main { +@@ -278,7 +278,8 @@ public class Main { //System.out.println("Loading libraries, please wait..."); //net.minecraft.server.Main.main(options); diff --git a/patches/server/0011-Purpur-Server-Changes.patch b/patches/server/0011-Purpur-Server-Changes.patch index 7ff6cc827..228b842e6 100644 --- a/patches/server/0011-Purpur-Server-Changes.patch +++ b/patches/server/0011-Purpur-Server-Changes.patch @@ -8,7 +8,7 @@ TODO - Dreeam: Check Fix-pufferfish-issues.patch Original license: MIT Original project: https://github.com/PurpurMC/Purpur -Commit: 930003b1d1826c083f3cee4db79621e6a7d726f1 +Commit: 4e55e26f4dcd046f68c977b6348ad3ae265aa896 Patches below are removed in this patch: Brand changes in Rebrand.patch @@ -2529,7 +2529,7 @@ index 09fdea983772612ef3fff6b2da3cf469a34e4ec0..b69d924fa8034eabbf4aab8d3434f4f4 protected ParticleOptions getInkParticle() { return ParticleTypes.GLOW_SQUID_INK; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index da8c5d45f50091946309afa4130f410e40c69a50..65d475803716ea30453ec2397403581def8939fb 100644 +index 8191eda135b71d0515c918e88b35aaeec21c59de..cb2d6bb3ab2d07dc0756591be0be76a3f6f8a5d6 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -236,9 +236,9 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -12628,10 +12628,10 @@ index 8575941fd238750c5d56843989a48bcbde2d8a88..b4ed2df8d0795409808df0205edce6da protected double getDefaultGravity() { return 0.06D; diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -index 3e4f72012f07863b6dfc14a36d07b66c4641c560..85983dd81dbc9f2d187a224298b56613dab18f8a 100644 +index e312002f8afc6b77d9923381169cfe498206f5a0..617043b24fbf073038ffc5252da75c4cfaf85d38 100644 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java -@@ -400,7 +400,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { +@@ -406,7 +406,7 @@ public abstract class Projectile extends Entity implements TraceableEntity { public boolean mayInteract(Level world, BlockPos pos) { Entity entity = this.getOwner(); @@ -12996,7 +12996,7 @@ index 32910f677b0522ac8ec513fa0d00b714b52cfae4..c491291b522aebf34c7d990d2b485d1a // CraftBukkit start public boolean checkReachable = true; diff --git a/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java b/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java -index 6474b6063992d2c643c21187663de499f37b32d6..c374962128a37307093218a9ec46386cc860c376 100644 +index 58a5338e73aedaa3744dced128ac3eb6f5f6f87e..f032a3e76e2af3ebd67d202066f3bcac8e52d29e 100644 --- a/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java +++ b/src/main/java/net/minecraft/world/inventory/AbstractFurnaceMenu.java @@ -147,7 +147,13 @@ public abstract class AbstractFurnaceMenu extends RecipeBookMenu { @@ -13881,7 +13881,7 @@ index 06497b5141e611cc7a1b6030a7b9c54b5c4eda06..28df1b3230762e52b5458ac93a85c9a5 return InteractionResult.PASS; } diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index fd939864da9f79c56c8cbfa3c521e2d12e6e33cd..cbb97a6f3d8b003e4b90431bbe4ac4c633d50203 100644 +index 804297a04988b3e21092a42df6584b7fc3cff1bb..b341ce21de28b2ee829dcba64b7dd6952fc1c17d 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -497,6 +497,7 @@ public final class ItemStack implements DataComponentHolder { @@ -13894,7 +13894,7 @@ index fd939864da9f79c56c8cbfa3c521e2d12e6e33cd..cbb97a6f3d8b003e4b90431bbe4ac4c6 world.preventPoiUpdated = false; @@ -529,6 +530,7 @@ public final class ItemStack implements DataComponentHolder { if (!(block.getBlock() instanceof BaseEntityBlock)) { // Containers get placed automatically - block.onPlace(world, newblockposition, oldBlock, true, context); // Paper - pass context + block.onPlace(world, newblockposition, oldBlock, true, context); } + block.getBlock().forgetPlacer(); // Purpur @@ -14333,7 +14333,7 @@ index 141b748abe80402731cdaf14a3d36aa7cef4f4bd..d5d2a6467b48bcf8e5322dd5938f6e4f if (range < 0.0 || d < range * range) { return true; diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java -index 0c9c75e3c094e22aad926977545d2ae7075e33ad..ff36324eb2d34ca414d7b7f3a91a9ef52eaf10d0 100644 +index e895eb8049268560031e8483635668aa3f83dbe0..23e3d75286b98f23816417b48bb1fbe6be68b6bd 100644 --- a/src/main/java/net/minecraft/world/level/Explosion.java +++ b/src/main/java/net/minecraft/world/level/Explosion.java @@ -340,7 +340,7 @@ public class Explosion { @@ -16401,10 +16401,10 @@ index 205e223c356634bd6bc6bd58c6f0b7fda61a6f5f..bea05cb928d540a2f19b51bb7352d032 } diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index ded6d148110fe3fbb6272ce44582a28472dd49a6..80d68b91ea4e4eb97e31d1df0c430740fb56bd74 100644 +index d0109633e8bdf109cfc9178963d7b6cf92f8b189..40f15a30b1a0dd2040e75045f32f33082e70aaeb 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -85,7 +85,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -86,7 +86,7 @@ public abstract class BlockBehaviour implements FeatureElement { protected static final Direction[] UPDATE_SHAPE_ORDER = new Direction[]{Direction.WEST, Direction.EAST, Direction.NORTH, Direction.SOUTH, Direction.DOWN, Direction.UP}; public final boolean hasCollision; @@ -16413,7 +16413,7 @@ index ded6d148110fe3fbb6272ce44582a28472dd49a6..80d68b91ea4e4eb97e31d1df0c430740 protected final boolean isRandomlyTicking; protected final SoundType soundType; protected final float friction; -@@ -93,7 +93,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -94,7 +94,7 @@ public abstract class BlockBehaviour implements FeatureElement { protected final float jumpFactor; protected final boolean dynamicShape; protected final FeatureFlagSet requiredFeatures; @@ -16563,10 +16563,10 @@ index d5004290e40a1ff5e0fcfe75f8da34ae15962359..f26383cf896785333dbd6f86348d5a5f } else if (blockState.is(Blocks.HONEY_BLOCK)) { return PathType.STICKY_HONEY; diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java -index 57139a0b8adcd1ea25cd100be78402681856ee75..e8793e11e94eea41ea9be615f0d46c7add836919 100644 +index 86d95edc7dd1e42b4b38eba1177cd508e72e4fc4..6c07fc507df6070854f5950a8616d2949c040656 100644 --- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java +++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java -@@ -32,7 +32,7 @@ public class PortalShape { +@@ -31,7 +31,7 @@ public class PortalShape { private static final int MIN_HEIGHT = 3; public static final int MAX_HEIGHT = 21; private static final BlockBehaviour.StatePredicate FRAME = (iblockdata, iblockaccess, blockposition) -> { @@ -17050,7 +17050,7 @@ index 1f354c6c09bc49e57a69db7cfa4f2a331dd02bdb..b251b057ec6e0bb90d140be8f4d24a6c public Collection getStructures(int x, int z) { return this.getStructures(x, z, struct -> true); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index e45a2a0c9e461486d3a70f75630ffbc7443ce04e..9f6027268903c81da4cd1e94cf4ac9fa238440e0 100644 +index c63dfc0b740ce2e544ad920188d7d7dfc2ae3e04..95dc6e535b1e8ef6d58a64df814286ce5df8dc08 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -176,6 +176,14 @@ public class Main { @@ -17068,7 +17068,7 @@ index e45a2a0c9e461486d3a70f75630ffbc7443ce04e..9f6027268903c81da4cd1e94cf4ac9fa // Paper start acceptsAll(asList("server-name"), "Name of the server") .withRequiredArg() -@@ -265,7 +273,7 @@ public class Main { +@@ -259,7 +267,7 @@ public class Main { System.setProperty(net.minecrell.terminalconsole.TerminalConsoleAppender.JLINE_OVERRIDE_PROPERTY, "false"); // Paper } @@ -17645,10 +17645,10 @@ index 86574da257731de7646a712ed73384955fe35aa3..e223234dd64b0e41441c3b9f649f0b64 + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 0ab53d46f0b8f3f3791dd01766738522c86932e8..98891112f992978c97b21ab0d7d54228819b7536 100644 +index 8dd85b9ca3b3e3429de4d0ec0654982589c6e93e..198a86fc9b8c4dba8c8de27bccc4de65690b84de 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -597,6 +597,15 @@ public class CraftEventFactory { +@@ -601,6 +601,15 @@ public class CraftEventFactory { // Paper end craftServer.getPluginManager().callEvent(event); @@ -17664,7 +17664,7 @@ index 0ab53d46f0b8f3f3791dd01766738522c86932e8..98891112f992978c97b21ab0d7d54228 return event; } -@@ -1127,7 +1136,7 @@ public class CraftEventFactory { +@@ -1131,7 +1140,7 @@ public class CraftEventFactory { return CraftEventFactory.callEntityDamageEvent(source.getDirectBlock(), source.getDirectBlockState(), entity, DamageCause.LAVA, bukkitDamageSource, modifiers, modifierFunctions, cancelled); } else if (source.getDirectBlock() != null) { DamageCause cause; @@ -17673,7 +17673,7 @@ index 0ab53d46f0b8f3f3791dd01766738522c86932e8..98891112f992978c97b21ab0d7d54228 cause = DamageCause.CONTACT; } else if (source.is(DamageTypes.HOT_FLOOR)) { cause = DamageCause.HOT_FLOOR; -@@ -1187,6 +1196,7 @@ public class CraftEventFactory { +@@ -1191,6 +1200,7 @@ public class CraftEventFactory { EntityDamageEvent event; if (damager != null) { event = new EntityDamageByEntityEvent(damager.getBukkitEntity(), damagee.getBukkitEntity(), cause, bukkitDamageSource, modifiers, modifierFunctions, critical); @@ -17720,42 +17720,59 @@ index af1ae3dacb628da23f7d2988c6e76d3fb2d64103..4ee2d501f882279b48edb4b8bf082458 for (int i = 0; i < this.getSize(); i++) { if (i >= items.length) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java -index 9ee14589d63bbfc0880f2eee5e924fe946ee0035..062783f30f41761c34d7679844e443e9a55c6011 100644 +index 792cb6adf0c7a6335cc5985fce8bed2e0f1149af..4e8dc7d638009a24f2d64647f8ef56fbe12c52db 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryAnvil.java -@@ -9,7 +9,7 @@ import org.bukkit.inventory.AnvilInventory; - public class CraftInventoryAnvil extends CraftResultInventory implements AnvilInventory { - - private final Location location; -- private final AnvilMenu container; -+ public final AnvilMenu container; // Purpur - private -> public - Anvil API +@@ -19,6 +19,10 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn + private int repairCost; + private int repairCostAmount; + private int maximumRepairCost; ++ // Purpur start - Anvil API ++ private boolean bypassCost; ++ private boolean canDoUnsafeEnchants; ++ // Purpur end - Anvil API - public CraftInventoryAnvil(Location location, Container inventory, Container resultInventory, AnvilMenu container) { + public CraftInventoryAnvil(Location location, Container inventory, Container resultInventory) { super(inventory, resultInventory); -@@ -57,4 +57,26 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn - Preconditions.checkArgument(levels >= 0, "Maximum repair cost must be positive (or 0)"); - this.container.maximumRepairCost = levels; +@@ -27,6 +31,10 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn + this.repairCost = CraftInventoryAnvil.DEFAULT_REPAIR_COST; + this.repairCostAmount = CraftInventoryAnvil.DEFAULT_REPAIR_COST_AMOUNT; + this.maximumRepairCost = CraftInventoryAnvil.DEFAULT_MAXIMUM_REPAIR_COST; ++ // Purpur start - Anvil API ++ this.bypassCost = false; ++ this.canDoUnsafeEnchants = false; ++ // Purpur end - Anvil API + } + + @Override +@@ -113,4 +121,30 @@ public class CraftInventoryAnvil extends CraftResultInventory implements AnvilIn + consumer.accept(cav); + } } + -+ // Purpur start - Anvil API ++ /// Purpur start - Anvil API + @Override + public boolean canBypassCost() { -+ return this.container.bypassCost; ++ this.syncWithArbitraryViewValue((cav) -> this.bypassCost = cav.canBypassCost()); ++ return this.bypassCost; + } + + @Override + public void setBypassCost(boolean bypassCost) { -+ this.container.bypassCost = bypassCost; ++ this.bypassCost = bypassCost; ++ this.syncViews((cav) -> cav.setBypassCost(bypassCost)); + } + + @Override + public boolean canDoUnsafeEnchants() { -+ return this.container.canDoUnsafeEnchants; ++ this.syncWithArbitraryViewValue((cav) -> this.canDoUnsafeEnchants = cav.canDoUnsafeEnchants()); ++ return this.canDoUnsafeEnchants; + } + + @Override + public void setDoUnsafeEnchants(boolean canDoUnsafeEnchants) { -+ this.container.canDoUnsafeEnchants = canDoUnsafeEnchants; ++ this.canDoUnsafeEnchants = canDoUnsafeEnchants; ++ this.syncViews((cav) -> cav.setDoUnsafeEnchants(canDoUnsafeEnchants)); + } + // Purpur end - Anvil API } @@ -17771,6 +17788,37 @@ index c76c78bb7757d407102271463e14716a1b012deb..458b91582a22fb1e6deb1551c38d2a10 // Paper start - support "empty" choices } else if (bukkit == RecipeChoice.empty()) { stack = Ingredient.EMPTY; +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/view/CraftAnvilView.java b/src/main/java/org/bukkit/craftbukkit/inventory/view/CraftAnvilView.java +index e2d8d69c5ae8feb6840462ba8332344972658d83..d1505efcf861224f0b3c9837072690155b36ae32 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/view/CraftAnvilView.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/view/CraftAnvilView.java +@@ -63,4 +63,26 @@ public class CraftAnvilView extends CraftInventoryView implements Anv + this.setMaximumRepairCost(legacy.getMaximumRepairCost()); + } + } ++ ++ // Purpur start - Anvil API ++ @Override ++ public boolean canBypassCost() { ++ return this.container.bypassCost; ++ } ++ ++ @Override ++ public void setBypassCost(boolean bypassCost) { ++ this.container.bypassCost = bypassCost; ++ } ++ ++ @Override ++ public boolean canDoUnsafeEnchants() { ++ return this.container.canDoUnsafeEnchants; ++ } ++ ++ @Override ++ public void setDoUnsafeEnchants(boolean canDoUnsafeEnchants) { ++ this.container.canDoUnsafeEnchants = canDoUnsafeEnchants; ++ } ++ // Purpur end - Anvil API + } diff --git a/src/main/java/org/bukkit/craftbukkit/legacy/MaterialRerouting.java b/src/main/java/org/bukkit/craftbukkit/legacy/MaterialRerouting.java index d7c8f26b21276d9ff1d5c7c9738cc1126ce7d4b9..f0471f92044612e3a2fd12a575b8b1f844790d3a 100644 --- a/src/main/java/org/bukkit/craftbukkit/legacy/MaterialRerouting.java diff --git a/patches/server/0030-Leaves-Server-Utils.patch b/patches/server/0030-Leaves-Server-Utils.patch index 6aafa09c2..5eb4959ca 100644 --- a/patches/server/0030-Leaves-Server-Utils.patch +++ b/patches/server/0030-Leaves-Server-Utils.patch @@ -9,7 +9,7 @@ and change store way to sql maybe? Original license: GPLv3 Original project: https://github.com/LeavesMC/Leaves -Commit: 248cb933f1a67a50a94352da2c100722e4635575 +Commit: 1782bd4806074628c93c2ef265e028b4fbdba081 diff --git a/src/main/java/org/leavesmc/leaves/LeavesLogger.java b/src/main/java/org/leavesmc/leaves/LeavesLogger.java new file mode 100644 diff --git a/patches/server/0081-Remove-stream-in-BlockBehaviour-cache-blockstate.patch b/patches/server/0081-Remove-stream-in-BlockBehaviour-cache-blockstate.patch index ee6162726..613589c00 100644 --- a/patches/server/0081-Remove-stream-in-BlockBehaviour-cache-blockstate.patch +++ b/patches/server/0081-Remove-stream-in-BlockBehaviour-cache-blockstate.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Remove stream in BlockBehaviour cache blockstate diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -index 80d68b91ea4e4eb97e31d1df0c430740fb56bd74..46c410763edba2399b080ca72937a9883f295bfb 100644 +index 40f15a30b1a0dd2040e75045f32f33082e70aaeb..cdaa5a8af0c6a8a78e587141b9ab1c84766589e9 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java -@@ -1384,7 +1384,7 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -1385,7 +1385,7 @@ public abstract class BlockBehaviour implements FeatureElement { @Nullable final VoxelShape[] occlusionShapes; protected final VoxelShape collisionShape; @@ -17,7 +17,7 @@ index 80d68b91ea4e4eb97e31d1df0c430740fb56bd74..46c410763edba2399b080ca72937a988 private final boolean[] faceSturdy; protected final boolean isCollisionShapeFullBlock; -@@ -1416,9 +1416,14 @@ public abstract class BlockBehaviour implements FeatureElement { +@@ -1417,9 +1417,14 @@ public abstract class BlockBehaviour implements FeatureElement { if (!this.collisionShape.isEmpty() && state.hasOffsetFunction()) { throw new IllegalStateException(String.format(Locale.ROOT, "%s has a collision shape and an offset type, but is not marked as dynamicShape in its properties.", BuiltInRegistries.BLOCK.getKey(block))); } else {