SPIGOT-4493: Allow burnt out furnaces to remain lit like Vanilla whilst retaining SPIGOT-844 API

This commit is contained in:
md_5 2018-12-22 11:04:31 +11:00
parent bc943daf94
commit 24c5e68c5f
2 changed files with 5 additions and 19 deletions

View file

@ -48,15 +48,6 @@
public TileEntityFurnace() {
super(TileEntityTypes.FURNACE);
this.items = NonNullList.a(3, ItemStack.a);
@@ -219,7 +253,7 @@
}
public void tick() {
- boolean flag = this.isBurning();
+ boolean flag = this.getBlock().get(BlockFurnace.LIT); // CraftBukkit - SPIGOT-844 - Check if furnace block is lit using the block instead of burn time
boolean flag1 = false;
if (this.isBurning()) {
@@ -237,9 +271,20 @@
IRecipe irecipe = this.world.getCraftingManager().b(this, this.world);
@ -80,15 +71,7 @@
flag1 = true;
if (!itemstack.isEmpty()) {
Item item = itemstack.getItem();
@@ -270,6 +315,7 @@
if (flag != this.isBurning()) {
flag1 = true;
this.world.setTypeAndData(this.position, (IBlockData) this.world.getType(this.position).set(BlockFurnace.LIT, this.isBurning()), 3);
+ this.invalidateBlockCache(); // CraftBukkit - Invalidate tile entity's cached block type
}
}
@@ -280,7 +326,7 @@
@@ -280,7 +325,7 @@
}
private int s() {
@ -97,7 +80,7 @@
return furnacerecipe != null ? furnacerecipe.h() : 200;
}
@@ -307,11 +353,38 @@
@@ -307,11 +352,38 @@
ItemStack itemstack1 = irecipe.d();
ItemStack itemstack2 = (ItemStack) this.items.get(2);

View file

@ -1,5 +1,6 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.BlockFurnace;
import net.minecraft.server.TileEntityFurnace;
import org.bukkit.Material;
import org.bukkit.block.Block;
@ -40,6 +41,8 @@ public class CraftFurnace extends CraftContainer<TileEntityFurnace> implements F
@Override
public void setBurnTime(short burnTime) {
this.getSnapshot().setProperty(0, burnTime);
// SPIGOT-844: Allow lighting and relighting using this API
this.data = this.data.set(BlockFurnace.LIT, burnTime > 0);
}
@Override