org.bukkit.Material#SNOW源码实例Demo

下面列出了org.bukkit.Material#SNOW 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: BedWars   文件: WorldListener.java
@EventHandler
public void onForm(BlockFormEvent event) {
    if (event.isCancelled()) {
        return;
    }

    if (event.getNewState().getType() == Material.SNOW) {
        return;
    }

    for (String s : Main.getGameNames()) {
        Game game = Main.getGame(s);
        if (game.getStatus() == GameStatus.RUNNING || game.getStatus() == GameStatus.GAME_END_CELEBRATING) {
            if (GameCreator.isInArea(event.getBlock().getLocation(), game.getPos1(), game.getPos2())) {
                if (!game.isBlockAddedDuringGame(event.getBlock().getLocation())) {
                    event.setCancelled(true);
                }
                return;
            }
        }
    }
}
 
源代码2 项目: BedWars   文件: WorldListener.java
@EventHandler
public void onForm(BlockFormEvent event) {
    if (event.isCancelled()) {
        return;
    }

    if (event.getNewState().getType() == Material.SNOW) {
        return;
    }

    for (String s : Main.getGameNames()) {
        Game game = Main.getGame(s);
        if (game.getStatus() == GameStatus.RUNNING || game.getStatus() == GameStatus.GAME_END_CELEBRATING) {
            if (GameCreator.isInArea(event.getBlock().getLocation(), game.getPos1(), game.getPos2())) {
                if (!game.isBlockAddedDuringGame(event.getBlock().getLocation())) {
                    event.setCancelled(true);
                }
                return;
            }
        }
    }
}
 
源代码3 项目: SonarPet   文件: EntityHorsePet.java
@Override
public void makeStepSound(int i, int j, int k, Material block) {
    BlockSoundData soundData = INMS.getInstance().getBlockSoundData(block);

    if (getBukkitEntity().getWorld().getBlockAt(i, j + 1, k).getType() == Material.SNOW) {
        soundData = INMS.getInstance().getBlockSoundData(Material.SNOW);
    }

    if (!INMS.getInstance().isLiquid(block)) {
        if (!getEntity().getPassengers().isEmpty() && getHorseType() != HorseType.NORMAL && getHorseType() != HorseType.MULE) {
            ++this.stepSoundCount;
            if (this.stepSoundCount > 5 && this.stepSoundCount % 3 == 0) {
                getEntity().playSound(SafeSound.HORSE_GALLOP, soundData.getVolume() * 0.15F, soundData.getPitch());
                if (getHorseType() == HorseType.NORMAL && this.random() .nextInt(10) == 0) {
                    getEntity().playSound(SafeSound.HORSE_BREATHE, soundData.getVolume() * 0.6F, soundData.getPitch());
                }
            } else if (this.stepSoundCount <= 5) {
                getEntity().playSound(SafeSound.HORSE_STEP_WOOD, soundData.getVolume() * 0.15F, soundData.getPitch());
            }
        } else if (soundData.equals(BlockSoundData.WOOD)) {
            getEntity().playSound(SafeSound.HORSE_STEP_WOOD, soundData.getVolume() * 0.15F, soundData.getPitch());
        } else {
            getEntity().playSound(SafeSound.HORSE_STEP, soundData.getVolume() * 0.15F, soundData.getPitch());
        }
    }
}
 
源代码4 项目: BedwarsRel   文件: BlockListener.java
@EventHandler(ignoreCancelled = true)
public void onForm(BlockFormEvent form) {

  if (form.getNewState().getType() != Material.SNOW) {
    return;
  }

  Game game =
      BedwarsRel.getInstance().getGameManager().getGameByLocation(form.getBlock().getLocation());
  if (game == null) {
    return;
  }

  if (game.getState() == GameState.STOPPED) {
    return;
  }

  form.setCancelled(true);
}
 
源代码5 项目: GlobalWarming   文件: SnowForm.java
@EventHandler
public void blockFormEvent(BlockFormEvent event) {
    if (event.getNewState().getType() == Material.SNOW) {
        WorldClimateEngine climateEngine = ClimateEngine.getInstance().getClimateEngine(event.getBlock().getWorld().getUID());
        if (climateEngine != null && climateEngine.isEffectEnabled(ClimateEffectType.SNOW_FORMATION)) {
            double temperature = climateEngine.getTemperature();
            if (event.getBlock().getY() < heightMap.getValue(temperature)) {
                event.setCancelled(true);
            }
        }
    }
}
 
源代码6 项目: Hawk   文件: WrappedBlock8.java
private boolean isReallySolid(Block b) {
    boolean reallySolid = block.getMaterial().isSolid();
    MaterialData matData = b.getState().getData();
    if (matData instanceof Sign || matData instanceof Banner)
        reallySolid = false;
    else if (matData instanceof FlowerPot || matData instanceof Diode || matData instanceof Skull ||
            b.getType() == Material.CARPET || matData instanceof Ladder ||
            b.getType() == Material.REDSTONE_COMPARATOR || b.getType() == Material.REDSTONE_COMPARATOR_ON ||
            b.getType() == Material.REDSTONE_COMPARATOR_OFF || b.getType() == Material.SOIL ||
            b.getType() == Material.WATER_LILY || b.getType() == Material.SNOW || b.getType() == Material.COCOA) {
        reallySolid = true;
    }
    return reallySolid;
}
 
 方法所在类
 同类方法