From 8683cde7c048a53c315e4e7848dc2639670dc71d Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Thu, 22 Apr 2021 16:45:28 -0700 Subject: [PATCH] add consumeFuel to FurnaceBurnEvent --- .../entity/AbstractFurnaceBlockEntity.java.patch | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch index 7f9069ea9b..b6b9a83fe6 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java.patch @@ -38,7 +38,7 @@ protected AbstractFurnaceBlockEntity(BlockEntityType blockEntityType, BlockPos pos, BlockState state, RecipeType recipeType) { super(blockEntityType, pos, state); -@@ -110,8 +125,39 @@ +@@ -110,9 +125,40 @@ } }; this.recipesUsed = new Reference2IntOpenHashMap(); @@ -46,7 +46,7 @@ + this.quickCheck = RecipeManager.createCheck((RecipeType) recipeType); // CraftBukkit - decompile error // Eclipse fail + this.recipeType = recipeType; // Paper - cook speed multiplier API } -+ + + // CraftBukkit start - add fields and methods + private int maxStack = MAX_STACK; + public List transaction = new java.util.ArrayList(); @@ -76,9 +76,10 @@ + this.maxStack = size; + } + // CraftBukkit end - ++ private boolean isLit() { return this.litTimeRemaining > 0; + } @@ -135,6 +181,11 @@ this.recipesUsed.put(ResourceKey.create(Registries.RECIPE, ResourceLocation.parse(s)), nbttagcompound1.getInt(s)); } @@ -108,7 +109,7 @@ } else { recipeholder = null; } -@@ -183,9 +235,20 @@ +@@ -183,11 +235,22 @@ int i = blockEntity.getMaxStackSize(); if (!blockEntity.isLit() && AbstractFurnaceBlockEntity.canBurn(world.registryAccess(), recipeholder, singlerecipeinput, blockEntity.items, i)) { @@ -129,8 +130,11 @@ + if (blockEntity.isLit() && furnaceBurnEvent.isBurning()) { + // CraftBukkit end flag1 = true; - if (flag3) { +- if (flag3) { ++ if (flag3 && furnaceBurnEvent.willConsumeFuel()) { // Paper - add consumeFuel to FurnaceBurnEvent Item item = itemstack.getItem(); + + itemstack.shrink(1); @@ -199,11 +262,23 @@ }