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


Java Material.STATIONARY_LAVA属性代码示例

本文整理汇总了Java中org.bukkit.Material.STATIONARY_LAVA属性的典型用法代码示例。如果您正苦于以下问题:Java Material.STATIONARY_LAVA属性的具体用法?Java Material.STATIONARY_LAVA怎么用?Java Material.STATIONARY_LAVA使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.bukkit.Material的用法示例。


在下文中一共展示了Material.STATIONARY_LAVA属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: WaterFowLimitor

@EventHandler
  public void WaterFowLimitor(BlockFromToEvent event) {
if(ConfigOptimize.WaterFlowLimitorenable == true){
	Block block = event.getBlock();
	Chunk chunk = block.getChunk();
       if (block.getType() == Material.STATIONARY_WATER || block.getType() == Material.STATIONARY_LAVA) {
           if(CheckFast(block.getChunk())){
           	if(CheckedTimes.get(chunk) == null){
       			CheckedTimes.put(chunk, 0);
       		}
       		CheckedTimes.put(chunk, CheckedTimes.get(chunk) + 1);
       		if(CheckedTimes.get(chunk) > ConfigOptimize.WaterFlowLimitorPerChunkTimes){
       			event.setCancelled(true);
       		}
           }else{
               ChunkLastTime.put(block.getChunk(), System.currentTimeMillis());
           }
       }
}
  }
 
开发者ID:GelandiAssociation,项目名称:EscapeLag,代码行数:20,代码来源:WaterFlowLimitor.java

示例2: leakCheck

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void leakCheck(final BlockTransformEvent event) {
    if(event.getWorld() != this.match.getWorld()) return;

    if(event.getNewState().getType() == Material.STATIONARY_LAVA) {
        Vector blockVector = BlockUtils.center(event.getNewState()).toVector();
        for(Core core : this.cores) {
            if(!core.hasLeaked() && core.getLeakRegion().contains(blockVector)) {
                // core has leaked
                core.markLeaked();
                this.match.getPluginManager().callEvent(new CoreLeakEvent(this.match, core, event.getNewState()));
                this.match.getPluginManager().callEvent(new GoalCompleteEvent(core,
                                                                              true,
                                                                              c -> false,
                                                                              c -> !c.equals(core.getOwner()),
                                                                              core.getContributions()));
            }
        }
    }
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:20,代码来源:CoreMatchModule.java

示例3: isSwimming

public static boolean isSwimming(Location location, Material liquidType) {
    Material material = location.getBlock().getType();
    switch(liquidType) {
        case WATER:
        case STATIONARY_WATER:
            return material == Material.WATER || material == Material.STATIONARY_WATER;

        case LAVA:
        case STATIONARY_LAVA:
            return material == Material.LAVA || material == Material.STATIONARY_LAVA;

        default:
            return false;
    }
}
 
开发者ID:WarzoneMC,项目名称:Warzone,代码行数:15,代码来源:PlayerBlockChecker.java

示例4: isLiquid

public boolean isLiquid() {
    return (getType() == Material.WATER) || (getType() == Material.STATIONARY_WATER) || (getType() == Material.LAVA) || (getType() == Material.STATIONARY_LAVA);
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:3,代码来源:CraftBlock.java

示例5: isLava

public static boolean isLava(Material material) {
    return material == Material.LAVA || material == Material.STATIONARY_LAVA;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:3,代码来源:Materials.java


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