PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockOre.patch
CraftBukkit/Spigot 43702a9e10 Update to Minecraft 1.18-pre5
By: md_5 <git@md-5.net>
2021-11-22 09:00:00 +11:00

24 lines
962 B
Diff

--- a/net/minecraft/world/level/block/BlockOre.java
+++ b/net/minecraft/world/level/block/BlockOre.java
@@ -25,13 +25,20 @@
@Override
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack);
+ // CraftBukkit start - Delegated to getExpDrop
+ }
+
+ @Override
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
+ // CraftBukkit end
if (EnchantmentManager.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
int i = this.xpRange.sample(worldserver.random);
if (i > 0) {
- this.popExperience(worldserver, blockposition, i);
+ return i; // CraftBukkit
}
}
+ return 0; // CraftBukkit
}
}