diff options
author | Bjarne Koll <[email protected]> | 2024-06-14 15:16:29 +0200 |
---|---|---|
committer | Bjarne Koll <[email protected]> | 2024-06-14 15:16:29 +0200 |
commit | 69d1d0a4f4ea5e117f68464ea67e2fbc0ae358bb (patch) | |
tree | c2ccdfa2a84d9b8c7245ffd77c273cf9f9ca871e | |
parent | a308c7c8d79df18a3e217e30c2c0900590fc4e81 (diff) | |
download | Paper-69d1d0a4f4ea5e117f68464ea67e2fbc0ae358bb.tar.gz Paper-69d1d0a4f4ea5e117f68464ea67e2fbc0ae358bb.zip |
Pretend to fix compile errors
6 files changed, 24 insertions, 16 deletions
diff --git a/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch b/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch index e583417246..1884316112 100644 --- a/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch +++ b/patches/server/0175-Implement-extended-PaperServerListPingEvent.patch @@ -60,7 +60,7 @@ index 0000000000000000000000000000000000000000..d926ad804355ee2fdc5910b2505e8671 +} diff --git a/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java new file mode 100644 -index 0000000000000000000000000000000000000000..6b0bdc266109cdfb874f08bf74323603921d2260 +index 0000000000000000000000000000000000000000..69433be355f284030ca79cba509a351bb32ccd8b --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/network/StandardPaperServerListPingEventImpl.java @@ -0,0 +1,116 @@ @@ -146,7 +146,7 @@ index 0000000000000000000000000000000000000000..6b0bdc266109cdfb874f08bf74323603 + + // Close connection immediately if event is cancelled + if (event.isCancelled()) { -+ networkManager.disconnect(null); ++ networkManager.disconnect((Component) null); + return; + } + diff --git a/patches/server/0437-Add-Destroy-Speed-API.patch b/patches/server/0437-Add-Destroy-Speed-API.patch index 3073fd31e7..bc04541e7c 100644 --- a/patches/server/0437-Add-Destroy-Speed-API.patch +++ b/patches/server/0437-Add-Destroy-Speed-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Destroy Speed API Co-authored-by: Jake Potrebic <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 9953b6b36cbcbfd1756bac478b568ca5700fc898..21ad2f461a5a578a2bf7fec1deeb421071245e6d 100644 +index 9953b6b36cbcbfd1756bac478b568ca5700fc898..9fd636424f1300e0b8263bdd26418e6892053f8f 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -721,4 +721,19 @@ public class CraftBlockData implements BlockData { +@@ -721,4 +721,24 @@ public class CraftBlockData implements BlockData { public BlockState createBlockState() { return CraftBlockStates.getBlockState(this.state, null); } @@ -20,10 +20,15 @@ index 9953b6b36cbcbfd1756bac478b568ca5700fc898..21ad2f461a5a578a2bf7fec1deeb4210 + net.minecraft.world.item.ItemStack nmsItemStack = CraftItemStack.unwrap(itemStack); + float speed = nmsItemStack.getDestroySpeed(this.state); + if (speed > 1.0F && considerEnchants) { -+ int enchantLevel = net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.EFFICIENCY, nmsItemStack); -+ if (enchantLevel > 0) { -+ speed += enchantLevel * enchantLevel + 1; -+ } ++ final org.apache.commons.lang3.mutable.MutableFloat mutableFloat = new org.apache.commons.lang3.mutable.MutableFloat(0); ++ net.minecraft.world.item.enchantment.EnchantmentHelper.forEachModifier( ++ nmsItemStack, net.minecraft.world.entity.EquipmentSlotGroup.MAINHAND, ++ (attributeHolder, attributeModifier) -> { ++ if (!attributeHolder.is(net.minecraft.world.entity.ai.attributes.Attributes.MINING_EFFICIENCY)) return; ++ ++ // TODO do we just attempt to calculate the full "modifier" to the mining efficiency? ++ } ++ ); + } + return speed; + } diff --git a/patches/server/0686-Implement-enchantWithLevels-API.patch b/patches/server/0686-Implement-enchantWithLevels-API.patch index 0c2c92c381..f8d9bb82f2 100644 --- a/patches/server/0686-Implement-enchantWithLevels-API.patch +++ b/patches/server/0686-Implement-enchantWithLevels-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement enchantWithLevels API diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index cd0b6819da81978b9186c83ee926e1fed5ee6fe4..01c441bcede88ce663c6b47b027c6239381c62c8 100644 +index cd0b6819da81978b9186c83ee926e1fed5ee6fe4..6d1eab448f368be8e1d768712f80f2c4d93c5e1a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -606,4 +606,26 @@ public final class CraftItemFactory implements ItemFactory { +@@ -606,4 +606,29 @@ public final class CraftItemFactory implements ItemFactory { return eggItem == null ? null : new net.minecraft.world.item.ItemStack(eggItem).asBukkitMirror(); } // Paper end - old getSpawnEgg API @@ -24,12 +24,15 @@ index cd0b6819da81978b9186c83ee926e1fed5ee6fe4..01c441bcede88ce663c6b47b027c6239 + if (internalStack.isEnchanted()) { + internalStack.set(net.minecraft.core.component.DataComponents.ENCHANTMENTS, null); + } ++ final net.minecraft.core.RegistryAccess registryAccess = net.minecraft.server.MinecraftServer.getServer().registryAccess(); ++ final net.minecraft.core.Registry<Enchantment> enchantments = registryAccess.registryOrThrow(Registries.ENCHANTMENT); + final net.minecraft.world.item.ItemStack enchanted = net.minecraft.world.item.enchantment.EnchantmentHelper.enchantItem( -+ MinecraftServer.getServer().getWorldData().enabledFeatures(), + new org.bukkit.craftbukkit.util.RandomSourceWrapper(random), + internalStack, + levels, -+ allowTreasure ++ enchantments.holders() ++ .<net.minecraft.core.Holder<Enchantment>>map(r -> r) ++ .filter(r -> allowTreasure || !r.is(EnchantmentTags.TREASURE)) + ); + return CraftItemStack.asCraftMirror(enchanted); + } diff --git a/patches/server/0737-Block-Ticking-API.patch b/patches/server/0737-Block-Ticking-API.patch index f9900a3d65..341f5a79ac 100644 --- a/patches/server/0737-Block-Ticking-API.patch +++ b/patches/server/0737-Block-Ticking-API.patch @@ -46,10 +46,10 @@ index 6d10396347b69d9243ab902ecc68ede93fa17b7d..af219df5267589300f0ad1d30fa5c81a // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 21ad2f461a5a578a2bf7fec1deeb421071245e6d..de4bbb73a78d037b99d662df130c7e122fda6cee 100644 +index 9fd636424f1300e0b8263bdd26418e6892053f8f..bfa0ec7bbf18b47546a4c2d3409164e3e53a9fb5 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -736,4 +736,11 @@ public class CraftBlockData implements BlockData { +@@ -741,4 +741,11 @@ public class CraftBlockData implements BlockData { return speed; } // Paper end - destroy speed API diff --git a/patches/server/0844-fix-item-meta-for-tadpole-buckets.patch b/patches/server/0844-fix-item-meta-for-tadpole-buckets.patch index 00c52e632f..b3fab8868c 100644 --- a/patches/server/0844-fix-item-meta-for-tadpole-buckets.patch +++ b/patches/server/0844-fix-item-meta-for-tadpole-buckets.patch @@ -5,7 +5,7 @@ Subject: [PATCH] fix item meta for tadpole buckets diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 01c441bcede88ce663c6b47b027c6239381c62c8..06af600a82f16c54f0774d93266deb8dd1c662cf 100644 +index 6d1eab448f368be8e1d768712f80f2c4d93c5e1a..c4ec0165dc0d2bba829c2310596e70a1b224e225 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java @@ -377,6 +377,7 @@ public final class CraftItemFactory implements ItemFactory { diff --git a/patches/server/0907-Add-API-to-get-the-collision-shape-of-a-block-before.patch b/patches/server/0907-Add-API-to-get-the-collision-shape-of-a-block-before.patch index 48e81c5809..8c1635a676 100644 --- a/patches/server/0907-Add-API-to-get-the-collision-shape-of-a-block-before.patch +++ b/patches/server/0907-Add-API-to-get-the-collision-shape-of-a-block-before.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add API to get the collision shape of a block before it's diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index de4bbb73a78d037b99d662df130c7e122fda6cee..162e10ce5481d1f94afae595114920ef9df51c61 100644 +index bfa0ec7bbf18b47546a4c2d3409164e3e53a9fb5..260285a3b0643e3262e3e7c01db23889755998aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java @@ -679,6 +679,20 @@ public class CraftBlockData implements BlockData { |