Java 类org.bukkit.inventory.BeaconInventory 实例源码

项目:QuarSK    文件:SExprBeaconFuel.java   
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode) {
    Block b = getExpr().getSingle(e);
    if (b == null) {
        return;
    }
    if (b.getState() instanceof BeaconInventory) {
        ((BeaconInventory) b.getState()).setItem((ItemStack) delta[0]);
    }
}
项目:QuarSK    文件:SExprBeaconFuel.java   
@Nullable
@Override
public ItemStack convert(@NotNull Block block) {
    BlockState state = block.getState();
    return state instanceof BeaconInventory ? ((BeaconInventory) state).getItem() : null;
}