本文整理匯總了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);
}
}
示例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);
}
}
示例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());
}
}
示例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());
}
}
示例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)");
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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)");
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}