本文整理汇总了Java中cn.nukkit.block.BlockLiquid类的典型用法代码示例。如果您正苦于以下问题:Java BlockLiquid类的具体用法?Java BlockLiquid怎么用?Java BlockLiquid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlockLiquid类属于cn.nukkit.block包,在下文中一共展示了BlockLiquid类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockUpdate
import cn.nukkit.block.BlockLiquid; //导入依赖的package包/类
@EventHandler (ignoreCancelled = true)
public void onBlockUpdate(BlockUpdateEvent event){
Block block = event.getBlock();
if(this.getConfig().get("block-flowing", true) && block instanceof BlockLiquid){
if(!this.provider.canUpdate(block)){
event.setCancelled(true);
}
}
}
示例2: getMaterial
import cn.nukkit.block.BlockLiquid; //导入依赖的package包/类
private Map<String, Object> getMaterial(Block b) {
Map<String, Object> map = new LinkedHashMap<String, Object>();
Item item = Item.get(b.getId(), b.getDamage());
map.put("powerSource", b.isPowerSource());
map.put("lightOpacity", Block.lightFilter[b.getId()]);
map.put("lightValue", b.getLightLevel());
// map.put("usingNeighborLight", b.getUseNeighborBrightness(bs));
map.put("hardness", b.getHardness());
map.put("resistance", b.getResistance());
// map.put("ticksRandomly", b.tickRate());
map.put("tickRate", b.tickRate());
map.put("fullCube", b.isSolid() && !b.isTransparent());
map.put("slipperiness", b.getFrictionFactor());
map.put("renderedAsNormalBlock", !b.isTransparent());
//map.put("solidFullCube", b.isSolidFullCube());
map.put("liquid", b instanceof BlockLiquid);
map.put("solid", b.isSolid());
map.put("movementBlocker", b.hasEntityCollision());
//map.put("blocksLight", m.blocksLight());
map.put("burnable", b.getBurnAbility() > 0);
map.put("opaque", !b.isTransparent());
map.put("replacedDuringPlacement", b.canBeReplaced());
map.put("toolRequired", b.getToolType() != 0);
map.put("canBeFlowedInto", b.canBeFlowedInto());
// map.put("fragileWhenPushed", b instanceof BlockFlowable);
// map.put("unpushable", m.getMobilityFlag() == EnumPushReaction.BLOCK);
// map.put("adventureModeExempt", b.getField(m, Material.class, "isAdventureModeExempt", "field_85159_M"));
map.put("mapColor", rgb(b.getColor().getRGB()));
map.put("ambientOcclusionLightValue", b.isSolid() ? 0.2F : 1.0F);
// try {
// map.put("ambientOcclusionLightValue", b.b.getAmbientOcclusionLightValue(bs));
// } catch (NoSuchMethodError ignored) {
// map.put("ambientOcclusionLightValue", b.isBlockNormalCube(bs) ? 0.2F : 1.0F);
// }
map.put("grassBlocking", false); // idk what this property was originally supposed to be...grass uses a combination of light values to check growth
return map;
}