Skip to content

Commit

Permalink
Fix unbreakable flint and steel consumed when igniting creepers (#9509)
Browse files Browse the repository at this point in the history
  • Loading branch information
Machine-Maker authored Jul 19, 2023
1 parent 40adc23 commit c016e03
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions patches/server/0873-Fix-a-bunch-of-vanilla-bugs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ https://bugs.mojang.com/browse/MC-123848
by: BillyGalbreath <[email protected]>
Fixes item frames dropping items above when pointing down

https://bugs.mojang.com/browse/MC-264285
Fix unbreakable flint and steel being consumed when igniting creepers

Co-authored-by: William Blake Galbreath <[email protected]>

diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
Expand Down Expand Up @@ -248,6 +251,19 @@ index a86472cce8e8fcde16d761842fe443a619f6e305..b42c060a5d8d68b5773a8a5e38c59707
private void removeFramedMap(ItemStack itemstack) {
this.getFramedMapId().ifPresent((i) -> {
MapItemSavedData worldmap = MapItem.getSavedData(i, this.level());
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 7fe90ebc8eced53f72c7f935e40745075f02421b..fd1b5a1beea7594fa65decfdcccfa15781fc005b 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
@@ -248,7 +248,7 @@ 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()) {
+ if (itemstack.getItem().getMaxDamage() == 0) { // Paper - fix MC-264285, only shrink the stack if the item type actually has no durability
itemstack.shrink(1);
} else {
itemstack.hurtAndBreak(1, player, (entityhuman1) -> {
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 f174094febfdfdc309f1b50877be60bae8a98156..5f407535298a31a34cfe114dd863fd6a9b977707 100644
--- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
Expand Down

0 comments on commit c016e03

Please sign in to comment.