mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-03 13:27:23 +01:00
Pretend to fix compile errors
This commit is contained in:
parent
d29210d668
commit
be8b9314b4
3 changed files with 15 additions and 7 deletions
|
@ -20,10 +20,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ 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;
|
||||
+ }
|
||||
|
|
|
@ -24,12 +24,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ 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);
|
||||
+ }
|
||||
|
|
|
@ -146,7 +146,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
+ // Close connection immediately if event is cancelled
|
||||
+ if (event.isCancelled()) {
|
||||
+ networkManager.disconnect(null);
|
||||
+ networkManager.disconnect((Component) null);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
|
|
Loading…
Add table
Reference in a new issue