From e849888abbcf44a4d1661beb50ff3271bcaf529f Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Tue, 13 Dec 2022 09:23:05 -0800 Subject: [PATCH] Fix fire charge not being consumed igniting a creeper (#8652) --- .../server/Fix-a-bunch-of-vanilla-bugs.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/patches/server/Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch index 7a5d54e235..359af9f57e 100644 --- a/patches/server/Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/Fix-a-bunch-of-vanilla-bugs.patch @@ -36,6 +36,10 @@ https://bugs.mojang.com/browse/MC-121048 clear the CombatTracker if the entity is dead. This fixes death messages such as the "doomed to fall" messages. +https://bugs.mojang.com/browse/MC-257875 + by: Jake Potrebic + Fixes server not consuming fire charges when igniting a creeper + Co-authored-by: William Blake Galbreath Co-authored-by: MelnCat @@ -172,6 +176,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (!player.getAbilities().instabuild) { stack.shrink(1); } +diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java ++++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java +@@ -0,0 +0,0 @@ public class Creeper extends Monster implements PowerableMob { + this.level.playSound(player, 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()) { // Paper - only call hurtAndBreak for a damageable item - MC-257875 + itemstack.hurtAndBreak(1, player, (entityhuman1) -> { + entityhuman1.broadcastBreakEvent(hand); + }); ++ // Paper start - just consume the item - MC-257875 ++ } else if (!player.getAbilities().instabuild) { ++ itemstack.shrink(1); ++ } ++ // Paper end + } + + return InteractionResult.sidedSuccess(this.level.isClientSide); diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java