當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。