本文整理汇总了Java中org.spongepowered.api.block.BlockTypes.SNOW_LAYER属性的典型用法代码示例。如果您正苦于以下问题:Java BlockTypes.SNOW_LAYER属性的具体用法?Java BlockTypes.SNOW_LAYER怎么用?Java BlockTypes.SNOW_LAYER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.spongepowered.api.block.BlockTypes
的用法示例。
在下文中一共展示了BlockTypes.SNOW_LAYER属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isTransparent
private static boolean isTransparent(BlockState blockstate, boolean waterIsTransparent) {
if (blockstate.getType() == BlockTypes.SNOW_LAYER) {
return false;
}
IBlockState iblockstate = (IBlockState)(Object) blockstate;
Optional<MatterProperty> matterProperty = blockstate.getProperty(MatterProperty.class);
if (!waterIsTransparent && matterProperty.isPresent() && matterProperty.get().getValue() == MatterProperty.Matter.LIQUID) {
return false;
}
return !iblockstate.isOpaqueCube();
}
示例2: onBlockInteract
@Listener
public void onBlockInteract(InteractBlockEvent event, @First Player player) {
BlockType type = event.getTargetBlock().getState().getType();
if (type == BlockTypes.SNOW_LAYER && contains(player)) {
player.getInventory().offer(newItemStack(ItemTypes.SNOWBALL, 16));
}
}