Paper/nms-patches/BlockOre.patch

33 lines
1.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
2020-08-11 23:00:00 +02:00
public void dropNaturally(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
super.dropNaturally(iblockdata, worldserver, blockposition, itemstack);
+ /* CraftBukkit start - Delegated to getExpDrop
2019-04-23 04:00:00 +02:00
if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
2020-08-11 23:00:00 +02:00
int i = this.a(worldserver.random);
2019-04-23 04:00:00 +02:00
@@ -22,6 +23,21 @@
2020-08-11 23:00:00 +02:00
this.dropExperience(worldserver, blockposition, i);
2019-04-23 04:00:00 +02:00
}
}
2015-02-26 23:41:06 +01:00
+ // */
}
2019-04-23 04:00:00 +02:00
+
+ @Override
2020-08-11 23:00:00 +02:00
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
2019-04-23 04:00:00 +02:00
+ if (EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
2020-08-11 23:00:00 +02:00
+ int i = this.a(worldserver.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
}