我正在使用Material.{something}.isFuel()
来获取某物品是否为燃料来源,但是如何获得该燃料来源的燃烧时间是什么呢??
答案 0 :(得分:0)
据我所知,没有任何东西。 但是您可以创建一个包含燃料信息的枚举,如以下插口文章所示:
public enum Fuel {
LAVA_BUCKET(Material.LAVA_BUCKET, 20000),
COAL_BLOCK(Material.COAL_BLOCK, 16000),
BLAZE_ROD(Material.BLAZE_ROD, 2400)
// ...
private Material type;
private int burntime;
public Fuel(Material type, int burntime) {
this.type = type;
this.burntime = burntime;
}
public int getBurnTime() {
return burntime;
}
}