mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 13:07:06 +01:00
SPIGOT-3020: Fix issue with BlockBreakEvent throwing AssertionError when setting a player's tool to AIR/NULL
This commit is contained in:
parent
8fb65851f1
commit
f6227934a3
1 changed files with 4 additions and 2 deletions
|
@ -41,15 +41,17 @@
|
||||||
if (entityhuman instanceof EntityPlayer) {
|
if (entityhuman instanceof EntityPlayer) {
|
||||||
CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition, itemstack);
|
CriterionTriggers.y.a((EntityPlayer) entityhuman, blockposition, itemstack);
|
||||||
}
|
}
|
||||||
@@ -55,7 +75,7 @@
|
@@ -55,8 +75,8 @@
|
||||||
|
|
||||||
SoundEffectType soundeffecttype = iblockdata1.getStepSound();
|
SoundEffectType soundeffecttype = iblockdata1.getStepSound();
|
||||||
|
|
||||||
- world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F);
|
- world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F);
|
||||||
|
- if (entityhuman == null || !entityhuman.abilities.canInstantlyBuild) {
|
||||||
+ // world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F);
|
+ // world.playSound(entityhuman, blockposition, this.a(iblockdata1), SoundCategory.BLOCKS, (soundeffecttype.a() + 1.0F) / 2.0F, soundeffecttype.b() * 0.8F);
|
||||||
if (entityhuman == null || !entityhuman.abilities.canInstantlyBuild) {
|
+ if ((entityhuman == null || !entityhuman.abilities.canInstantlyBuild) && itemstack != ItemStack.b) { // CraftBukkit
|
||||||
itemstack.subtract(1);
|
itemstack.subtract(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,6 +112,21 @@
|
@@ -92,6 +112,21 @@
|
||||||
|
|
||||||
if (nbttagcompound != null) {
|
if (nbttagcompound != null) {
|
||||||
|
|
Loading…
Reference in a new issue