mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
Fix looting enchant using wrong variable
This commit is contained in:
parent
70aace0312
commit
744e1a177a
@ -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 New Issue
Block a user