本文整理汇总了Java中org.bukkit.event.player.PlayerBedEnterEvent.setCancelled方法的典型用法代码示例。如果您正苦于以下问题:Java PlayerBedEnterEvent.setCancelled方法的具体用法?Java PlayerBedEnterEvent.setCancelled怎么用?Java PlayerBedEnterEvent.setCancelled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.event.player.PlayerBedEnterEvent
的用法示例。
在下文中一共展示了PlayerBedEnterEvent.setCancelled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSleep
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@EventHandler
public void onSleep(PlayerBedEnterEvent bee) {
Player p = bee.getPlayer();
Game g = BedwarsRel.getInstance().getGameManager().getGameOfPlayer(p);
if (g == null) {
return;
}
if (g.getState() == GameState.STOPPED) {
return;
}
bee.setCancelled(true);
}
示例2: OnPlayerBedEnterEvent
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
public void OnPlayerBedEnterEvent(PlayerBedEnterEvent event) {
Resident resident = CivGlobal.getResident(event.getPlayer().getName());
if (resident == null) {
event.setCancelled(true);
return;
}
coord.setFromLocation(event.getPlayer().getLocation());
Camp camp = CivGlobal.getCampFromChunk(coord);
if (camp != null) {
if (!camp.hasMember(event.getPlayer().getName())) {
CivMessage.sendError(event.getPlayer(), "You cannot sleep in a camp you do not belong to.");
event.setCancelled(true);
return;
}
}
}
示例3: onPlayerBedEnter
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
/**
* On player bed enter.
*
* @param event
* the event
*/
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerBedEnter(PlayerBedEnterEvent event) {
if (!playerConf.get(event.getPlayer()).isAdminMod()) {
IDummyLand land = Factoid.getThisPlugin().iLands().getLandOrOutsideArea(
event.getBed().getLocation());
if ((land instanceof ILand && ((ILand) land).isBanned(event
.getPlayer()))
|| (!checkPermission(land, event.getPlayer(),
PermissionList.SLEEP.getPermissionType()))) {
messagePermission(event.getPlayer());
event.setCancelled(true);
}
}
}
示例4: onPlayerBedEnter
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOW)
public void onPlayerBedEnter(final PlayerBedEnterEvent e) {
if (DEBUG) {
plugin.getLogger().info(e.getEventName());
}
// Check world
if (Util.inWorld(e.getPlayer())) {
if (actionAllowed(e.getPlayer(),e.getBed().getLocation(), SettingsFlag.BED)) {
return;
}
// Not allowed
Util.sendMessage(e.getPlayer(), plugin.getLocale(e.getPlayer().getUniqueId()).get("island.protected"));
e.setCancelled(true);
}
}
示例5: Sleep
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@EventHandler
public void Sleep(PlayerBedEnterEvent e){
if(rs.getPlayerData(e.getPlayer())==null)return;
PlayerData pd=rs.getPlayerData(e.getPlayer());
pd.setSleep(true,1);
pd.setBed(e.getBed());
e.setCancelled(false);
return;
}
示例6: onPlayerSleep
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.NORMAL)
public void onPlayerSleep(PlayerBedEnterEvent event) {
if (_moon.isActive()) {
event.setCancelled(true);
event.getPlayer().sendMessage(ChatColor.YELLOW + "You cannot sleep during a " + ChatColor.DARK_RED + " BLOOD MOON!");
}
}
示例7: onEnteringBed
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@HookHandler(priority = Priority.CRITICAL, ignoreCanceled = true)
public void onEnteringBed(final BedEnterHook hook) {
PlayerBedEnterEvent event =
new PlayerBedEnterEvent(new CanaryPlayer(hook.getPlayer()), new CanaryBlock(hook.getBed()));
event.setCancelled(hook.isCanceled());
server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
hook.setCanceled();
}
}
示例8: playerBedEnter
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
private void playerBedEnter(PlayerBedEnterEvent e) {
Player player = e.getPlayer();
if (assignedTools.containsKey(player)) {
Tool tool = assignedTools.get(player);
if (tool.item.equals(player.getItemInHand())) {
e.setCancelled(true);
}
}
}
示例9: onPlayerBedEnter
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.LOW)
public void onPlayerBedEnter(final PlayerBedEnterEvent e) {
if (DEBUG) {
plugin.getLogger().info(e.getEventName());
}
// Check world
if (inWorld(e.getPlayer())) {
if (actionAllowed(e.getPlayer(),e.getBed().getLocation(), SettingsFlag.BED)) {
return;
}
// Not allowed
Util.sendMessage(e.getPlayer(), ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected);
e.setCancelled(true);
}
}
示例10: onPlayerBedEnter
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
/**
* Triggered everytime a player right clicks on a bed.
* @param e
*/
@EventHandler
public void onPlayerBedEnter(PlayerBedEnterEvent e)
{
e.getPlayer().sendMessage(ChatColor.DARK_PURPLE + "Pas le temps de dormir !");
e.setCancelled(true);
}
示例11: onPlayerBedEnter
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@EventHandler
public void onPlayerBedEnter(PlayerBedEnterEvent event) {
Player p = event.getPlayer();
ArenaManager am = SimpleSurvivalGames.instance.getArenaManager();
// Is the current player playing
if(am.isInArena(p)) {
ArenaPlayer ap = am.getPlayer(p);
// Is the player in the lobby of the arena
if(ap.isInLobby()) {
// Has the player a arena spawn assigned
if(ap.hasAssignedAreanSpawn()) {
// Cancel the event and send a status message
event.setCancelled(true);
p.sendMessage(ChatColor.DARK_RED + "You aren't tired enough to enter the bed inside the lobby of an arena!");
}
}
// The player may not sleep
if(ap.isPlaying()) {
event.setCancelled(true);
p.sendMessage(ChatColor.DARK_RED + "You can't sleep while in the arena!");
}
// Is the player an spectators
if(ap.isSpectator()) {
event.setCancelled(true);
ap.sendMessage(ChatColor.DARK_RED + "You can't sleep while spectating!");
}
}
}
示例12: onPlayerBedEnter
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@EventHandler
public void onPlayerBedEnter(PlayerBedEnterEvent event)
{
event.setCancelled(true);
}
示例13: onBedEnter
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@EventHandler
public void onBedEnter(final PlayerBedEnterEvent event) {
if (!this.frozenPlayers.isEmpty() && !event.isCancelled() && this.frozenPlayers.containsKey(event.getPlayer().getUniqueId())) {
event.setCancelled(true);
}
}
示例14: PlayerBedEnter
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOW)
public void PlayerBedEnter(final PlayerBedEnterEvent event)
{
if (!plugin.isLoggedIn(event.getPlayer()))
event.setCancelled(true);
}
示例15: onPlayerBedEnter
import org.bukkit.event.player.PlayerBedEnterEvent; //导入方法依赖的package包/类
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
public void onPlayerBedEnter(PlayerBedEnterEvent event) {
if (listenerService.shouldCancelEvent(event)) {
event.setCancelled(true);
}
}