本文整理汇总了Java中cn.nukkit.block.BlockFurnaceBurning类的典型用法代码示例。如果您正苦于以下问题:Java BlockFurnaceBurning类的具体用法?Java BlockFurnaceBurning怎么用?Java BlockFurnaceBurning使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlockFurnaceBurning类属于cn.nukkit.block包,在下文中一共展示了BlockFurnaceBurning类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkFuel
import cn.nukkit.block.BlockFurnaceBurning; //导入依赖的package包/类
protected void checkFuel(Item fuel) {
FurnaceBurnEvent ev = new FurnaceBurnEvent(this, fuel, fuel.getFuelTime() == null ? 0 : fuel.getFuelTime());
if (ev.isCancelled()) {
return;
}
this.namedTag.putShort("MaxTime", ev.getBurnTime());
this.namedTag.putShort("BurnTime", ev.getBurnTime());
this.namedTag.putShort("BurnDuration", 0);
if (this.getBlock().getId() == Item.FURNACE) {
this.getLevel().setBlock(this, new BlockFurnaceBurning(this.getBlock().getDamage()), true);
}
if (this.namedTag.getShort("BurnTime") > 0 && ev.isBurning()) {
fuel.setCount(fuel.getCount() - 1);
if (fuel.getCount() == 0) {
fuel = new ItemBlock(new BlockAir(), 0, 0);
}
this.inventory.setFuel(fuel);
}
}
开发者ID:Creeperface01,项目名称:NukkitGT,代码行数:24,代码来源:BlockEntityFurnace.java
示例2: checkFuel
import cn.nukkit.block.BlockFurnaceBurning; //导入依赖的package包/类
protected void checkFuel(Item fuel) {
FurnaceBurnEvent ev = new FurnaceBurnEvent(this, fuel, fuel.getFuelTime() == null ? 0 : fuel.getFuelTime());
if (ev.isCancelled()) {
return;
}
maxTime = ev.getBurnTime();
burnTime = ev.getBurnTime();
burnDuration = 0;
if (this.getBlock().getId() == Item.FURNACE) {
this.getLevel().setBlock(this, new BlockFurnaceBurning(this.getBlock().getDamage()), true);
}
if (burnTime > 0 && ev.isBurning()) {
fuel.setCount(fuel.getCount() - 1);
if (fuel.getCount() == 0) {
fuel = new ItemBlock(new BlockAir(), 0, 0);
}
this.inventory.setFuel(fuel);
}
}
开发者ID:NycuRO,项目名称:Apollo-OLD,代码行数:24,代码来源:BlockEntityFurnace.java
示例3: checkFuel
import cn.nukkit.block.BlockFurnaceBurning; //导入依赖的package包/类
protected void checkFuel(Item fuel) {
FurnaceBurnEvent ev = new FurnaceBurnEvent(this, fuel, fuel.getFuelTime() == null ? 0 : fuel.getFuelTime());
if (ev.isCancelled()) {
return;
}
maxTime = ev.getBurnTime();
burnTime = ev.getBurnTime();
burnDuration = 0;
if (this.getBlock().getId() == Item.FURNACE) {
this.getLevel().setBlock(this, new BlockFurnaceBurning(this.getBlock().getDamage()), true);
}
if (burnTime > 0 && ev.isBurning()) {
fuel.setCount(fuel.getCount() - 1);
if (fuel.getCount() == 0) {
if (fuel.getId() == Item.BUCKET && fuel.getDamage() == 10) {
fuel.setDamage(0);
fuel.setCount(1);
} else {
fuel = new ItemBlock(new BlockAir(), 0, 0);
}
}
this.inventory.setFuel(fuel);
}
}
开发者ID:Nukkit,项目名称:Nukkit,代码行数:29,代码来源:BlockEntityFurnace.java
注:本文中的cn.nukkit.block.BlockFurnaceBurning类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论