PaperMC/nms-patches/BlockOre.patch

33 lines
1 KiB
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/BlockOre.java
+++ b/net/minecraft/server/BlockOre.java
2019-04-23 04:00:00 +02:00
@@ -15,6 +15,7 @@
@Override
public void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
super.dropNaturally(iblockdata, world, blockposition, itemstack);
+ /* CraftBukkit start - Delegated to getExpDrop
2019-04-23 04:00:00 +02:00
if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
int i = this.a(world.random);
2019-04-23 04:00:00 +02:00
@@ -22,6 +23,21 @@
this.dropExperience(world, blockposition, i);
}
}
2015-02-26 23:41:06 +01:00
+ // */
}
2019-04-23 04:00:00 +02:00
+
+ @Override
2019-04-23 04:00:00 +02:00
+ public int getExpDrop(IBlockData iblockdata, World world, BlockPosition blockposition, ItemStack itemstack) {
+ if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
+ int i = this.a(world.random);
+
2019-04-23 04:00:00 +02:00
+ if (i > 0) {
+ return i;
+ }
+ }
2015-02-26 23:41:06 +01:00
+
+ return 0;
+ // CraftBukkit end
2015-02-26 23:41:06 +01:00
+ }
2019-04-23 04:00:00 +02:00
}