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

33 lines
1.1 KiB
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,6 +25,7 @@
@Override
public void dropNaturally(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
super.dropNaturally(iblockdata, worldserver, blockposition, itemstack);
+ /* CraftBukkit start - Delegated to getExpDrop
if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
int i = this.xpRange.a(worldserver.random);
@@ -32,6 +33,21 @@
this.dropExperience(worldserver, blockposition, i);
}
}
+ // */
}
+
+ @Override
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
+ if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
+ int i = this.xpRange.a(worldserver.random);
+
+ if (i > 0) {
+ return i;
+ }
+ }
+
+ return 0;
+ // CraftBukkit end
+ }
}