mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-04 22:14:40 +01:00
#705: Improve implementation of furnace related block states
CraftFurnace is the base class for all concrete types of furnaces (this mimics Minecraft's underlying type hierarchy). It is marked as abstract now to avoid accidental instantiation. Also, the various furnace sub types were missing type parameters.
This commit is contained in:
parent
f222b5bd4e
commit
69fddc725b
5 changed files with 7 additions and 8 deletions
|
@ -5,7 +5,7 @@ import org.bukkit.Material;
|
|||
import org.bukkit.block.BlastFurnace;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
public class CraftBlastFurnace extends CraftFurnace implements BlastFurnace {
|
||||
public class CraftBlastFurnace extends CraftFurnace<TileEntityBlastFurnace> implements BlastFurnace {
|
||||
|
||||
public CraftBlastFurnace(Block block) {
|
||||
super(block, TileEntityBlastFurnace.class);
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.bukkit.block.Furnace;
|
|||
import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
|
||||
import org.bukkit.inventory.FurnaceInventory;
|
||||
|
||||
public class CraftFurnace<T extends TileEntityFurnace> extends CraftContainer<T> implements Furnace {
|
||||
public abstract class CraftFurnace<T extends TileEntityFurnace> extends CraftContainer<T> implements Furnace {
|
||||
|
||||
public CraftFurnace(Block block, Class<T> tileEntityClass) {
|
||||
super(block, tileEntityClass);
|
||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.server.TileEntityFurnaceFurnace;
|
|||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
public class CraftFurnaceFurnace extends CraftFurnace {
|
||||
public class CraftFurnaceFurnace extends CraftFurnace<TileEntityFurnaceFurnace> {
|
||||
|
||||
public CraftFurnaceFurnace(Block block) {
|
||||
super(block, TileEntityFurnaceFurnace.class);
|
||||
|
|
|
@ -5,7 +5,7 @@ import org.bukkit.Material;
|
|||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.Smoker;
|
||||
|
||||
public class CraftSmoker extends CraftFurnace implements Smoker {
|
||||
public class CraftSmoker extends CraftFurnace<TileEntitySmoker> implements Smoker {
|
||||
|
||||
public CraftSmoker(Block block) {
|
||||
super(block, TileEntitySmoker.class);
|
||||
|
|
|
@ -23,7 +23,6 @@ import net.minecraft.server.TileEntityDropper;
|
|||
import net.minecraft.server.TileEntityEnchantTable;
|
||||
import net.minecraft.server.TileEntityEndGateway;
|
||||
import net.minecraft.server.TileEntityEnderChest;
|
||||
import net.minecraft.server.TileEntityFurnace;
|
||||
import net.minecraft.server.TileEntityFurnaceFurnace;
|
||||
import net.minecraft.server.TileEntityHopper;
|
||||
import net.minecraft.server.TileEntityJigsaw;
|
||||
|
@ -59,7 +58,7 @@ import org.bukkit.craftbukkit.block.CraftDropper;
|
|||
import org.bukkit.craftbukkit.block.CraftEnchantingTable;
|
||||
import org.bukkit.craftbukkit.block.CraftEndGateway;
|
||||
import org.bukkit.craftbukkit.block.CraftEnderChest;
|
||||
import org.bukkit.craftbukkit.block.CraftFurnace;
|
||||
import org.bukkit.craftbukkit.block.CraftFurnaceFurnace;
|
||||
import org.bukkit.craftbukkit.block.CraftHopper;
|
||||
import org.bukkit.craftbukkit.block.CraftJigsaw;
|
||||
import org.bukkit.craftbukkit.block.CraftJukebox;
|
||||
|
@ -333,7 +332,7 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
|
|||
if (te == null) {
|
||||
te = new TileEntityFurnaceFurnace();
|
||||
}
|
||||
return new CraftFurnace(material, (TileEntityFurnace) te);
|
||||
return new CraftFurnaceFurnace(material, (TileEntityFurnaceFurnace) te);
|
||||
case DISPENSER:
|
||||
if (te == null) {
|
||||
te = new TileEntityDispenser();
|
||||
|
@ -560,7 +559,7 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta
|
|||
valid = blockState instanceof CraftChest;
|
||||
break;
|
||||
case FURNACE:
|
||||
valid = blockState instanceof CraftFurnace;
|
||||
valid = blockState instanceof CraftFurnaceFurnace;
|
||||
break;
|
||||
case DISPENSER:
|
||||
valid = blockState instanceof CraftDispenser;
|
||||
|
|
Loading…
Reference in a new issue