本文整理汇总了Java中org.bukkit.event.block.BlockFadeEvent类的典型用法代码示例。如果您正苦于以下问题:Java BlockFadeEvent类的具体用法?Java BlockFadeEvent怎么用?Java BlockFadeEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BlockFadeEvent类属于org.bukkit.event.block包,在下文中一共展示了BlockFadeEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void onFade(BlockFadeEvent e) {
Game game = BedwarsRel.getInstance().getGameManager()
.getGameByLocation(e.getBlock().getLocation());
if (game == null) {
return;
}
if (game.getState() == GameState.STOPPED) {
return;
}
if (!game.getRegion().isPlacedBlock(e.getBlock())) {
e.setCancelled(true);
}
}
示例2: onBlockFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.LOWEST)
public void onBlockFade(final BlockFadeEvent event) {
final Block block = event.getBlock();
final Location location = block.getLocation();
final Material material = block.getType();
if (!reinforcementManager.isWorldActive(location.getWorld().getName())) {
return;
}
if (!Material.SNOW.equals(material) && !Material.ICE.equals(material) && !Material.SOIL.equals(material)) {
return;
}
if (!reinforcementManager.isReinforced(location)) {
return;
}
if (!allowBlockFading) {
event.setCancelled(true);
return;
}
Bukkit.getServer().getPluginManager().callEvent(new BlockDeinforceEvent(block, "Environment", true));
}
示例3: onBlockFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler
public void onBlockFade(BlockFadeEvent e) {
if (ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Block-Fade.Disable")) {
if (!ConfigGServerEvent.getConfig().getBoolean("Server.Disable.Block-Fade.World.All_World")) {
if (WorldUtils.getWBF().contains(e.getBlock().getWorld().getName())) {
e.setCancelled(true);
}
} else {
e.setCancelled(true);
}
}
}
示例4: onBlockFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGH)
public void onBlockFade(BlockFadeEvent event) {
switch (event.getBlock().getType()) {
case SNOW:
case ICE:
event.setCancelled(true);
break;
default:
break;
}
}
示例5: onBlockFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockFade(BlockFadeEvent e) {
boolean cancelled = false;
String w = e.getBlock().getWorld().getName();
for (String p : worlds.keySet()) {
for (int i = 0; i < worlds.get(p).size(); i++) {
if (worlds.get(p).get(i).equals(w)) {
if (!Minigame.getMinigameInstance(p).getConfigManager().isBlockFadeAllowed()) {
e.setCancelled(true);
cancelled = true;
break;
}
}
}
}
if (cancelled) {
return;
}
Block adjBlock = MGUtil.getAttachedSign(e.getBlock());
if (adjBlock != null) {
for (Minigame mg : Minigame.getMinigameInstances()) {
for (LobbySign l : mg.getLobbyManager().signs.values()) {
if (l.getX() == adjBlock.getX() && l.getY() == adjBlock.getY() && l.getZ() == adjBlock.getZ() &&
l.getWorld().equals(adjBlock.getWorld().getName())) {
e.setCancelled(true);
break;
}
}
}
}
}
示例6: onFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onFade(final BlockFadeEvent e) {
final Block b = e.getBlock();
final Location loc = BukkitUtil.getLocation(b.getLocation());
if (PlotSquared.isPlotWorld(loc.getWorld())) {
if (MainUtil.isPlotRoad(loc)) {
e.setCancelled(true);
}
}
}
示例7: onBlockFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event) {
Location location = BukkitUtil.adapt(event.getBlock().getLocation());
if (manager.isPlotWorld(location)) {
PlotId id = manager.getPlotId(location);
if (id == null) {
event.setCancelled(true);
} else {
event.setCancelled(api.isPlotLocked(id));
}
}
}
示例8: onFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onFade(BlockFadeEvent event) {
Block b = event.getBlock();
Location location = BukkitUtil.getLocation(b.getLocation());
PlotArea area = location.getPlotArea();
if (area == null) {
return;
}
Plot plot = area.getOwnedPlot(location);
if (plot == null) {
event.setCancelled(true);
return;
}
switch (b.getType()) {
case ICE:
if (Flags.ICE_MELT.isFalse(plot)) {
event.setCancelled(true);
}
break;
case SNOW:
if (Flags.SNOW_MELT.isFalse(plot)) {
event.setCancelled(true);
}
break;
case SOIL:
if (Flags.SOIL_DRY.isFalse(plot)) {
event.setCancelled(true);
}
break;
}
}
示例9: onBlockFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event)
{
if (this.getConfig(event.getBlock().getWorld()).block.fade.ignore.contains(event.getBlock().getType()))
{
return;
}
this.setAndLog(BlockFade.class, event.getBlock().getState(), AIR);
}
示例10: onBlockFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler(ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event) {
World world = event.getBlock().getWorld();
String biome = String.valueOf(event.getBlock().getBiome());
// if the biome has a bypass, allow ice to melt
if (PwnBuckets.containsCaseInsensitive(biome, PwnBuckets.icemeltBypass))
{
return;
}
if (PwnBuckets.isEnabledIn(world.getName()))
{
if(PwnBuckets.blockIceMelt)
{
//only care about water
if(event.getNewState().getType() == Material.STATIONARY_WATER)
{
Block block = event.getBlock();
block.setType(Material.WATER);
EvaporateWaterTask task = new EvaporateWaterTask(block);
plugin.getServer().getScheduler().runTaskLater(plugin, task, 30L);
event.setCancelled(true);
if (PwnBuckets.logEnabled)
{
PwnBuckets.logToFile("Blocked water source from ice melt");
}
}
}
}
}
示例11: onBlockBurn
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler
public void onBlockBurn(BlockFadeEvent event) {
Block block = event.getBlock();
String world = block.getWorld().getUID().toString();
Integer x = block.getLocation().getChunk().getX(), z = block.getLocation().getChunk().getZ();
if (QuickChecks.isWorldChunkClaimed(serverdata.get("worldmap").get(world), x, z, "cla")) {
if (((HashMap) ((HashMap) serverdata.get("worldmap").get(world).get(x)).get(z)).containsKey("str")) {
event.setCancelled(true);
}
}
}
示例12: onBlockFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler (priority = EventPriority.LOW, ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event) {
final Block fading = event.getBlock();
//Don't do a lookup if it isn't soil.
if (fading.getType() != Material.SOIL) {
return;
}
final Block top = event.getBlock().getRelative((BlockFace.UP));
if (plugin.getWorldRegistry().contains(top.getWorld().getName(), top.getX(), top.getY(), top.getZ())) {
event.setCancelled(true);
}
}
示例13: onBlockFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
/**
* Cancels block fade events in arenas not currently running.
* @param event The {@link org.bukkit.event.block.BlockFadeEvent} event.
*/
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onBlockFade(BlockFadeEvent event) {
Arena arena = ultimateGames.getArenaManager().getLocationArena(event.getBlock().getLocation());
if (arena != null && arena.getStatus() == ArenaStatus.RUNNING) {
arena.getGame().getGamePlugin().onBlockFade(arena, event);
} else {
event.setCancelled(true);
}
}
示例14: onBlockFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventHandler
public void onBlockFade(BlockFadeEvent event) {
event.setCancelled(true);
}
示例15: onBlockFade
import org.bukkit.event.block.BlockFadeEvent; //导入依赖的package包/类
@EventWrapper
public void onBlockFade(final BlockFadeEvent event) {
BlockState state = event.getBlock().getState();
this.callEvent(new BlockTransformEvent(event, state, BlockStateUtils.toAir(state)));
}