From 659728d2a7d451c7aa7f7f610a04554a531d2f99 Mon Sep 17 00:00:00 2001 From: Miles Holder Date: Sun, 17 Dec 2023 09:29:44 +1100 Subject: [PATCH] MC-264285, SPIGOT-7439, #1237: Fix unbreakable flint and steel is completely consumed while igniting creeper --- .../minecraft/world/entity/monster/EntityCreeper.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch b/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch index f3300fbf2..4a1e9252c 100644 --- a/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch +++ b/nms-patches/net/minecraft/world/entity/monster/EntityCreeper.patch @@ -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;