mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 19:34:09 +01:00
Fix looting enchant using wrong variable
By: md_5 <git@md-5.net>
This commit is contained in:
parent
1160f867a4
commit
001b26f1ae
1 changed files with 5 additions and 6 deletions
|
@ -123,7 +123,7 @@
|
|||
}
|
||||
|
||||
}
|
||||
@@ -192,13 +251,81 @@
|
||||
@@ -192,13 +251,80 @@
|
||||
}
|
||||
|
||||
public boolean breakBlock(BlockPosition blockposition) {
|
||||
|
@ -159,8 +159,7 @@
|
|||
+ if (nmsBlock != null && !event.isCancelled() && !this.isCreative() && this.player.hasBlock(nmsBlock.getBlockData())) {
|
||||
+ // Copied from block.a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, TileEntity tileentity)
|
||||
+ // PAIL: checkme each update
|
||||
+ if (!(nmsBlock.p() && EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) > 0)) {
|
||||
+ int data = block.getData();
|
||||
+ if (!(nmsBlock.o() && EnchantmentManager.getEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) > 0)) {
|
||||
+ int bonusLevel = EnchantmentManager.getEnchantmentLevel(Enchantments.LOOT_BONUS_BLOCKS, itemstack);
|
||||
+
|
||||
+ event.setExpToDrop(nmsBlock.getExpDrop(this.world, nmsData, bonusLevel));
|
||||
|
@ -206,7 +205,7 @@
|
|||
if ((block instanceof BlockCommand || block instanceof BlockStructure) && !this.player.dh()) {
|
||||
this.world.notify(blockposition, iblockdata, iblockdata, 3);
|
||||
return false;
|
||||
@@ -243,6 +370,12 @@
|
||||
@@ -243,6 +369,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -219,7 +218,7 @@
|
|||
return flag;
|
||||
}
|
||||
}
|
||||
@@ -283,7 +416,13 @@
|
||||
@@ -283,7 +415,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -233,7 +232,7 @@
|
|||
if (this.gamemode == EnumGamemode.SPECTATOR) {
|
||||
TileEntity tileentity = world.getTileEntity(blockposition);
|
||||
|
||||
@@ -340,6 +479,74 @@
|
||||
@@ -340,6 +478,74 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue