mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-21 07:50:52 +01:00
MC-264285, SPIGOT-7439, #1237: Fix unbreakable flint and steel is completely consumed while igniting creeper
By: Miles Holder <mwholder2005@gmail.com>
This commit is contained in:
parent
3c241dbb64
commit
6f023adfe9
1 changed files with 9 additions and 0 deletions
|
@ -34,6 +34,15 @@
|
|||
@Override
|
||||
protected EnumInteractionResult mobInteract(EntityHuman entityhuman, EnumHand enumhand) {
|
||||
ItemStack itemstack = entityhuman.getItemInHand(enumhand);
|
||||
@@ -231,7 +248,7 @@
|
||||
this.level().playSound(entityhuman, this.getX(), this.getY(), this.getZ(), soundeffect, this.getSoundSource(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F);
|
||||
if (!this.level().isClientSide) {
|
||||
this.ignite();
|
||||
- if (!itemstack.isDamageableItem()) {
|
||||
+ if (itemstack.getItem().getMaxDamage() == 0) { // CraftBukkit - fix MC-264285: unbreakable flint and steels are completely consumed when igniting a creeper
|
||||
itemstack.shrink(1);
|
||||
} else {
|
||||
itemstack.hurtAndBreak(1, entityhuman, (entityhuman1) -> {
|
||||
@@ -250,10 +267,19 @@
|
||||
if (!this.level().isClientSide) {
|
||||
float f = this.isPowered() ? 2.0F : 1.0F;
|
||||
|
|
Loading…
Add table
Reference in a new issue