cn.nukkit.inventory.FurnaceInventory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
package cn.nukkit.inventory;
import cn.nukkit.blockentity.BlockEntityFurnace;
import cn.nukkit.item.Item;
/**
* @author MagicDroidX (Nukkit Project)
*/
public class FurnaceInventory extends ContainerInventory {
public FurnaceInventory(BlockEntityFurnace furnace) {
super(furnace, InventoryType.FURNACE);
}
public FurnaceInventory(BlockEntityFurnace furnace, InventoryType inventoryType) {
super(furnace, inventoryType);
}
@Override
public BlockEntityFurnace getHolder() {
return (BlockEntityFurnace) this.holder;
}
public Item getResult() {
return this.getItem(2);
}
public Item getFuel() {
return this.getItem(1);
}
public Item getSmelting() {
return this.getItem(0);
}
public boolean setResult(Item item) {
return this.setItem(2, item);
}
public boolean setFuel(Item item) {
return this.setItem(1, item);
}
public boolean setSmelting(Item item) {
return this.setItem(0, item);
}
@Override
public void onSlotChange(int index, Item before, boolean send) {
super.onSlotChange(index, before, send);
this.getHolder().scheduleUpdate();
}
}