当前位置: 首页>>代码示例>>Java>>正文


Java BlockLiquid类代码示例

本文整理汇总了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);
		}
	}
}
 
开发者ID:EconomyS,项目名称:EconomyLand,代码行数:11,代码来源:EconomyLand.java

示例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;
    }
 
开发者ID:boy0001,项目名称:FastAsyncWorldedit,代码行数:38,代码来源:NukkitRegistryDumper.java


注:本文中的cn.nukkit.block.BlockLiquid类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。