本文整理匯總了Java中org.bukkit.event.block.BlockIgniteEvent.setCancelled方法的典型用法代碼示例。如果您正苦於以下問題:Java BlockIgniteEvent.setCancelled方法的具體用法?Java BlockIgniteEvent.setCancelled怎麽用?Java BlockIgniteEvent.setCancelled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.bukkit.event.block.BlockIgniteEvent
的用法示例。
在下文中一共展示了BlockIgniteEvent.setCancelled方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: FireSpread
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void FireSpread(BlockIgniteEvent e) {
if (ConfigGServerEvent.getConfig().getBoolean("Server.Disable.BlockIgnite-FireSpread.Enable")) {
if (!ConfigGServerEvent.getConfig().getBoolean("Server.Disable.BlockIgnite-FireSpread.World.All_World")) {
if (WorldUtils.getWFS().contains(e.getBlock().getWorld().getName())) {
if (e.getCause() == IgniteCause.SPREAD) {
e.setCancelled(true);
}
}
} else {
if (e.getCause() == IgniteCause.SPREAD) {
e.setCancelled(true);
}
}
}
}
示例2: onBlockStartBurn
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockStartBurn(BlockIgniteEvent e){
if (e.isCancelled()){
return;
}
Block b = e.getBlock();
Block bignit = e.getIgnitingBlock();
if ( b == null || bignit == null){
return;
}
RedProtect.get().logger.debug("Is BlockIgniteEvent event from global-listener");
Region r = RedProtect.get().rm.getTopRegion(b.getLocation());
if (r != null){
return;
}
if ((bignit.getType().equals(Material.FIRE) || bignit.getType().name().contains("LAVA")) && !RPConfig.getGlobalFlagBool(b.getWorld().getName()+".fire-spread")){
e.setCancelled(true);
}
}
示例3: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGH)
public void onBlockIgnite(final BlockIgniteEvent event) {
if (event.isCancelled())
return;
final Block block = event.getBlock();
// Ok so a frame block ignites
// Find the nearest gate!
final WorldCoord blockCoord = new WorldCoord(block);
final Gate nearestGate = Gates.gateFromFrameAndSurround(blockCoord);
if (nearestGate != null) {
event.setCancelled(true);
}
}
示例4: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockIgnite(BlockIgniteEvent 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")) {
String pvillage = ((HashMap) ((HashMap) serverdata.get("worldmap").get(world).get(x)).get(z)).get("cla").toString();
if (serverdata.get("villages").get(pvillage).containsKey("fire")) {
if (serverdata.get("villages").get(pvillage).get("fire").equals("off")) {
event.setCancelled(true);
}
} else if (Config.getString("Village Settings.Toggle Settings.Fire Enabled").equals("off")) {
event.setCancelled(true);
}
}
}
示例5: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.LOWEST)
public void onBlockIgnite(BlockIgniteEvent event) {
final Location location = event.getBlock().getLocation();
if (!reinforcementManager.isWorldActive(location.getWorld().getName())) {
return;
}
// If the block is not reinforced, it is allowed to burn normally.
if (!reinforcementManager.isReinforced(location)) {
return;
}
Player player = null;
if (BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL.equals(event.getCause())) {
player = event.getPlayer();
}
// If the block is reinforced, the burn event is cancelled for the block.
event.setCancelled(true);
// The block reinforcement is then damaged.
reinforcementManager.damageBlock(location, player, BlockSaverDamageCause.FIRE);
}
示例6: WhenFireLimitor
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void WhenFireLimitor(BlockIgniteEvent event) {
if (ConfigOptimize.FireLimitorenable == true) {
if (event.getCause() == IgniteCause.FLINT_AND_STEEL) {
return;
}
Block block = event.getBlock();
if (CheckFast(block.getChunk())) {
event.setCancelled(true);
} else {
ChunkChecked.put(block.getChunk(), System.currentTimeMillis());
}
}
}
示例7: fireSpread
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void fireSpread(final BlockIgniteEvent e) {
if (!cm.fireSpreadControllerEnabled) {
return;
}
if (BlockIgniteEvent.IgniteCause.SPREAD == e.getCause()) {
long now = System.currentTimeMillis();
if (now > this.lastfireSpread + cm.fireSpreadInterval) {
this.lastfireSpread = now;
} else {
e.setCancelled(true);
}
}
}
示例8: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGH)
public void onBlockIgnite(BlockIgniteEvent event) {
Player player = event.getPlayer();
if (player == null)
return;
long remaining = getRemaining(player);
if (remaining > 0L) {
event.setCancelled(true);
player.sendMessage(ChatColor.RED + "You cannot ignite blocks as your " + getDisplayName() + ChatColor.RED + " timer is active [" + ChatColor.BOLD
+ DurationFormatter.getRemaining(remaining, true, false) + ChatColor.RED + " remaining]");
}
}
示例9: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockIgnite(BlockIgniteEvent event)
{
//logger.info("Cause: " + event.getCause().name());
// Because we don't have any info about which player sent the fireball, disable block burning in World only (won't affect nether)
if(event.getCause() == BlockIgniteEvent.IgniteCause.FIREBALL
&& event.getBlock().getWorld().getName().equalsIgnoreCase("World"))
{
event.setCancelled(true);
}
}
示例10: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockIgnite(BlockIgniteEvent event)
{
IgniteCause ic = event.getCause();
if(ic != IgniteCause.FLINT_AND_STEEL)
event.setCancelled(true);
}
示例11: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.LOWEST)
public void onBlockIgnite (BlockIgniteEvent igniteEvent)
{
if(!GriefPrevention.instance.config_fireSpreads && igniteEvent.getCause() != IgniteCause.FLINT_AND_STEEL && igniteEvent.getCause() != IgniteCause.LIGHTNING)
{
igniteEvent.setCancelled(true);
}
}
示例12: onBlockStartBurn
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockStartBurn(BlockIgniteEvent e){
RedProtect.get().logger.debug("RPBlockListener - Is BlockIgniteEvent event");
if (e.isCancelled()){
return;
}
Block b = e.getBlock();
Block bignit = e.getIgnitingBlock();
if (b == null){
return;
}
RedProtect.get().logger.debug("Is BlockIgniteEvent event. Canceled? " + e.isCancelled());
Region r = RedProtect.get().rm.getTopRegion(b.getLocation());
if (r != null && !r.canFire()){
if (e.getIgnitingEntity() != null){
if (e.getIgnitingEntity() instanceof Player){
Player p = (Player) e.getIgnitingEntity();
if (!r.canBuild(p)){
RPLang.sendMessage(p, "blocklistener.region.cantplace");
e.setCancelled(true);
return;
}
} else {
e.setCancelled(true);
return;
}
}
if (bignit != null && (bignit.getType().equals(Material.FIRE) || bignit.getType().name().contains("LAVA"))){
e.setCancelled(true);
return;
}
if (e.getCause().equals(IgniteCause.LIGHTNING) || e.getCause().equals(IgniteCause.EXPLOSION) || e.getCause().equals(IgniteCause.FIREBALL)){
e.setCancelled(true);
}
}
}
示例13: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockIgnite(BlockIgniteEvent 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().isBlockIgniteAllowed()) {
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;
}
}
}
}
}
示例14: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
public void onBlockIgnite(BlockIgniteEvent e) {
for (CuboidSelection area : protectedAreas) {
if (area.contains(e.getBlock().getLocation())) {
e.setCancelled(true);
break;
}
}
}
示例15: onBlockIgnite
import org.bukkit.event.block.BlockIgniteEvent; //導入方法依賴的package包/類
@EventHandler
public void onBlockIgnite(BlockIgniteEvent event) {
if(event.getPlayer() != null) {
Lot lot = this.module.getLotManager().getLot(event.getBlock().getLocation());
Town town = this.module.getLotManager().getTown(event.getBlock().getLocation());
if(((lot != null && !lot.canBuild(event.getPlayer())) || (lot == null && town != null)) && !event.getPlayer().hasPermission(LotPermissions.BUILD_ANYWHERE)) {
sendMessage(event.getPlayer(), "lots.cannot-do");
event.setCancelled(true);
}
} else {
event.setCancelled(true);
}
}