Archiviert
13
0

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

Dieser Commit ist enthalten in:
md_5 2018-12-22 11:04:31 +11:00
Ursprung bc943daf94
Commit 24c5e68c5f
2 geänderte Dateien mit 5 neuen und 19 gelöschten Zeilen

Datei anzeigen

@ -48,15 +48,6 @@
public TileEntityFurnace() { public TileEntityFurnace() {
super(TileEntityTypes.FURNACE); super(TileEntityTypes.FURNACE);
this.items = NonNullList.a(3, ItemStack.a); 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 @@ @@ -237,9 +271,20 @@
IRecipe irecipe = this.world.getCraftingManager().b(this, this.world); IRecipe irecipe = this.world.getCraftingManager().b(this, this.world);
@ -80,15 +71,7 @@
flag1 = true; flag1 = true;
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
Item item = itemstack.getItem(); Item item = itemstack.getItem();
@@ -270,6 +315,7 @@ @@ -280,7 +325,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 @@
} }
private int s() { private int s() {
@ -97,7 +80,7 @@
return furnacerecipe != null ? furnacerecipe.h() : 200; return furnacerecipe != null ? furnacerecipe.h() : 200;
} }
@@ -307,11 +353,38 @@ @@ -307,11 +352,38 @@
ItemStack itemstack1 = irecipe.d(); ItemStack itemstack1 = irecipe.d();
ItemStack itemstack2 = (ItemStack) this.items.get(2); ItemStack itemstack2 = (ItemStack) this.items.get(2);

Datei anzeigen

@ -1,5 +1,6 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.server.BlockFurnace;
import net.minecraft.server.TileEntityFurnace; import net.minecraft.server.TileEntityFurnace;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -40,6 +41,8 @@ public class CraftFurnace extends CraftContainer<TileEntityFurnace> implements F
@Override @Override
public void setBurnTime(short burnTime) { public void setBurnTime(short burnTime) {
this.getSnapshot().setProperty(0, 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 @Override