PaperMC/paper-server/nms-patches/net/minecraft/world/level/block/BlockOre.patch

25 lines
962 B
Diff
Raw Normal View History

2021-03-15 23:00:00 +01:00
--- 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
}
}