當前位置: 首頁>>代碼示例>>Java>>正文


Java PlayerBucketFillEvent.isCancelled方法代碼示例

本文整理匯總了Java中org.bukkit.event.player.PlayerBucketFillEvent.isCancelled方法的典型用法代碼示例。如果您正苦於以下問題:Java PlayerBucketFillEvent.isCancelled方法的具體用法?Java PlayerBucketFillEvent.isCancelled怎麽用?Java PlayerBucketFillEvent.isCancelled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bukkit.event.player.PlayerBucketFillEvent的用法示例。


在下文中一共展示了PlayerBucketFillEvent.isCancelled方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onBucketFill

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
@EventHandler
public void onBucketFill(PlayerBucketFillEvent e){
   	if (e.isCancelled()) {
           return;
       }

   	Location l = e.getBlockClicked().getLocation();
	Region r = RedProtect.get().rm.getTopRegion(l);	
	if (r != null){
		return;
	}
	
	if (!RPUtil.canBuildNear(e.getPlayer(), l)){        	
           e.setCancelled(true);
       	return;    	
       }
	
   	if (!bypassBuild(e.getPlayer(), null, 0)) {
   		e.setCancelled(true);
	}
   }
 
開發者ID:FabioZumbi12,項目名稱:RedProtect,代碼行數:22,代碼來源:RPGlobalListener.java

示例2: onPlayerBucketFill

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerBucketFill(final PlayerBucketFillEvent event) {
	if (event.isCancelled())
		return;

	final Block block = event.getBlockClicked();
	final Block blockUp = block.getRelative(BlockFace.UP);

	// Ok so a player fills a bucket on a portal block
	// Find the nearest gate!
	final WorldCoord blockCoord = new WorldCoord(block);
	final WorldCoord blockCoordUp = new WorldCoord(blockUp);
	final Gate nearestGate = Gates.gateFromPortal(blockCoord);
	final Gate nearestGateUp = Gates.gateFromPortal(blockCoordUp);

	if (nearestGate != null || nearestGateUp != null) {
		event.setCancelled(true);
	}
}
 
開發者ID:NoChanceSD,項目名稱:AncientGates,代碼行數:20,代碼來源:PluginBlockListener.java

示例3: onFillBucket

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
@EventHandler
public void onFillBucket(PlayerBucketFillEvent event) {
    Block toEmpty = event.getBlockClicked().getRelative(event.getBlockFace());
    if (toEmpty.getY() >= height && !event.isCancelled()) {
        event.setCancelled(true);
        ChatUtil.sendWarningMessage(event.getPlayer(), ChatConstant.ERROR_BUILD_HEIGHT, ChatUtil.HIGHLIGHT.toString() + height + ChatColor.GRAY.toString());
    }
}
 
開發者ID:Minehut,項目名稱:GamePlate,代碼行數:9,代碼來源:BuildHeightModule.java

示例4: onBucketFill

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
/**
 * Prevents buckets from being filled
 */
@EventHandler
public void onBucketFill(PlayerBucketFillEvent event) {
    CuboidRegion region = regionHandler.getApplicableRegion(event.getBlockClicked().getLocation());
    if (!event.isCancelled() && region != null && !region.allows("destroy")) {
        event.setCancelled(true);
        warnPlayer(event.getPlayer());
    }
}
 
開發者ID:redwallhp,項目名稱:AthenaGM,代碼行數:12,代碼來源:BlockBreakListener.java

示例5: onFillBucket

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
@EventHandler
public void onFillBucket(PlayerBucketFillEvent event) {
    if (TeamUtils.getTeamByPlayer(event.getPlayer()).isObserver() || match.getState() != MatchState.PLAYING)
        return;
    Block toEmpty = event.getBlockClicked().getRelative(event.getBlockFace());
    if (toEmpty.getY() >= height && !event.isCancelled()) {
        event.setCancelled(true);
        ChatUtils.sendWarningMessage(event.getPlayer(), "You have reached the maximum build height! " + ChatColor.GRAY + "(" + height + " blocks)");
    }
}
 
開發者ID:dentmaged,項目名稱:Cardinal-Plus,代碼行數:11,代碼來源:BuildHeight.java

示例6: onBucketFill

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
@EventHandler
public void onBucketFill(PlayerBucketFillEvent event) {
    if (!event.isCancelled() && region.contains(new BlockRegion(null, event.getBlockClicked().getRelative(event.getBlockFace()).getLocation().toVector())) && filter.evaluate(event.getPlayer(), event.getBlockClicked().getRelative(event.getBlockFace()), event).equals(FilterState.DENY)) {
        event.setCancelled(true);
        ChatUtils.sendWarningMessage(event.getPlayer(), message);
    }
}
 
開發者ID:dentmaged,項目名稱:Cardinal-Plus,代碼行數:8,代碼來源:BlockBreakRegion.java

示例7: onBucketFill

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
public void onBucketFill(PlayerBucketFillEvent event) {
    if (!event.isCancelled() && filter.evaluate(event.getPlayer(), event.getBlockClicked().getRelative(event.getBlockFace()), event).equals(FilterState.DENY)
            && region.contains(new BlockRegion(null, event.getBlockClicked().getRelative(event.getBlockFace()).getLocation().toVector()))) {
        event.setCancelled(true);
        ChatUtils.sendWarningMessage(event.getPlayer(), message);
    }
}
 
開發者ID:dentmaged,項目名稱:Cardinal-Plus,代碼行數:8,代碼來源:BlockEventRegion.java

示例8: onBucketFill

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
@EventHandler
public void onBucketFill(PlayerBucketFillEvent e){
   	if (e.isCancelled()) {
           return;
       }
   	Player p = e.getPlayer();
   	Location l = e.getBlockClicked().getLocation();
	Region r = RedProtect.get().rm.getTopRegion(l);	
	
   	if (r != null && !r.canBuild(p) && (p.getItemInHand().getType().name().contains("BUCKET"))) {
   		e.setCancelled(true);
       }
   }
 
開發者ID:FabioZumbi12,項目名稱:RedProtect,代碼行數:14,代碼來源:RPPlayerListener.java

示例9: onFillBucket

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
@EventHandler
public void onFillBucket(PlayerBucketFillEvent event) {
    Block toEmpty = event.getBlockClicked().getRelative(event.getBlockFace());
    if (toEmpty.getY() >= height && !event.isCancelled()) {
        event.setCancelled(true);
        ChatUtil.sendWarningMessage(event.getPlayer(), "You have reached the maximum build height (" + ChatColor.AQUA + height + ChatColor.RED + " blocks)");
    }
}
 
開發者ID:twizmwazin,項目名稱:CardinalPGM,代碼行數:9,代碼來源:BuildHeight.java

示例10: onBucketFill

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
@EventHandler
public void onBucketFill(PlayerBucketFillEvent event) {
    if (!event.isCancelled() && region.contains(new BlockRegion(null, event.getBlockClicked().getRelative(event.getBlockFace()).getLocation().toVector())) && filter.evaluate(event.getPlayer(), event.getBlockClicked().getRelative(event.getBlockFace()), event).equals(FilterState.DENY)) {
        event.setCancelled(true);
        ChatUtil.sendWarningMessage(event.getPlayer(), message);
    }
}
 
開發者ID:twizmwazin,項目名稱:CardinalPGM,代碼行數:8,代碼來源:BlockBreakRegion.java

示例11: onBucketFill

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
@EventHandler
public void onBucketFill(PlayerBucketFillEvent event) {
    if (!event.isCancelled() && filter.evaluate(event.getPlayer(), event.getBlockClicked().getRelative(event.getBlockFace()), event).equals(FilterState.DENY)
            && region.contains(new BlockRegion(null, event.getBlockClicked().getRelative(event.getBlockFace()).getLocation().toVector()))) {
        event.setCancelled(true);
        ChatUtil.sendWarningMessage(event.getPlayer(), message);
    }
}
 
開發者ID:twizmwazin,項目名稱:CardinalPGM,代碼行數:9,代碼來源:BlockEventRegion.java

示例12: onBucketFill

import org.bukkit.event.player.PlayerBucketFillEvent; //導入方法依賴的package包/類
@EventHandler
public void onBucketFill(final PlayerBucketFillEvent event) {
	if (!this.frozenPlayers.isEmpty() && !event.isCancelled() && this.frozenPlayers.containsKey(event.getPlayer().getUniqueId())) {
		event.setCancelled(true);
	}
}
 
開發者ID:Craftolution,項目名稱:CraftoPlugin,代碼行數:7,代碼來源:FreezeComponent.java


注:本文中的org.bukkit.event.player.PlayerBucketFillEvent.isCancelled方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。