mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 00:07:56 +01:00
add consumeFuel to FurnaceBurnEvent
This commit is contained in:
parent
6a311ade3a
commit
8683cde7c0
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
protected AbstractFurnaceBlockEntity(BlockEntityType<?> blockEntityType, BlockPos pos, BlockState state, RecipeType<? extends AbstractCookingRecipe> recipeType) {
|
protected AbstractFurnaceBlockEntity(BlockEntityType<?> blockEntityType, BlockPos pos, BlockState state, RecipeType<? extends AbstractCookingRecipe> recipeType) {
|
||||||
super(blockEntityType, pos, state);
|
super(blockEntityType, pos, state);
|
||||||
@@ -110,8 +125,39 @@
|
@@ -110,9 +125,40 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.recipesUsed = new Reference2IntOpenHashMap();
|
this.recipesUsed = new Reference2IntOpenHashMap();
|
||||||
@ -46,7 +46,7 @@
|
|||||||
+ this.quickCheck = RecipeManager.createCheck((RecipeType<AbstractCookingRecipe>) recipeType); // CraftBukkit - decompile error // Eclipse fail
|
+ this.quickCheck = RecipeManager.createCheck((RecipeType<AbstractCookingRecipe>) recipeType); // CraftBukkit - decompile error // Eclipse fail
|
||||||
+ this.recipeType = recipeType; // Paper - cook speed multiplier API
|
+ this.recipeType = recipeType; // Paper - cook speed multiplier API
|
||||||
}
|
}
|
||||||
+
|
|
||||||
+ // CraftBukkit start - add fields and methods
|
+ // CraftBukkit start - add fields and methods
|
||||||
+ private int maxStack = MAX_STACK;
|
+ private int maxStack = MAX_STACK;
|
||||||
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||||
@ -76,9 +76,10 @@
|
|||||||
+ this.maxStack = size;
|
+ this.maxStack = size;
|
||||||
+ }
|
+ }
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
|
+
|
||||||
private boolean isLit() {
|
private boolean isLit() {
|
||||||
return this.litTimeRemaining > 0;
|
return this.litTimeRemaining > 0;
|
||||||
|
}
|
||||||
@@ -135,6 +181,11 @@
|
@@ -135,6 +181,11 @@
|
||||||
this.recipesUsed.put(ResourceKey.create(Registries.RECIPE, ResourceLocation.parse(s)), nbttagcompound1.getInt(s));
|
this.recipesUsed.put(ResourceKey.create(Registries.RECIPE, ResourceLocation.parse(s)), nbttagcompound1.getInt(s));
|
||||||
}
|
}
|
||||||
@ -108,7 +109,7 @@
|
|||||||
} else {
|
} else {
|
||||||
recipeholder = null;
|
recipeholder = null;
|
||||||
}
|
}
|
||||||
@@ -183,9 +235,20 @@
|
@@ -183,11 +235,22 @@
|
||||||
int i = blockEntity.getMaxStackSize();
|
int i = blockEntity.getMaxStackSize();
|
||||||
|
|
||||||
if (!blockEntity.isLit() && AbstractFurnaceBlockEntity.canBurn(world.registryAccess(), recipeholder, singlerecipeinput, blockEntity.items, i)) {
|
if (!blockEntity.isLit() && AbstractFurnaceBlockEntity.canBurn(world.registryAccess(), recipeholder, singlerecipeinput, blockEntity.items, i)) {
|
||||||
@ -129,8 +130,11 @@
|
|||||||
+ if (blockEntity.isLit() && furnaceBurnEvent.isBurning()) {
|
+ if (blockEntity.isLit() && furnaceBurnEvent.isBurning()) {
|
||||||
+ // CraftBukkit end
|
+ // CraftBukkit end
|
||||||
flag1 = true;
|
flag1 = true;
|
||||||
if (flag3) {
|
- if (flag3) {
|
||||||
|
+ if (flag3 && furnaceBurnEvent.willConsumeFuel()) { // Paper - add consumeFuel to FurnaceBurnEvent
|
||||||
Item item = itemstack.getItem();
|
Item item = itemstack.getItem();
|
||||||
|
|
||||||
|
itemstack.shrink(1);
|
||||||
@@ -199,11 +262,23 @@
|
@@ -199,11 +262,23 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user