本文整理汇总了Java中me.confuser.barapi.BarAPI.removeBar方法的典型用法代码示例。如果您正苦于以下问题:Java BarAPI.removeBar方法的具体用法?Java BarAPI.removeBar怎么用?Java BarAPI.removeBar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类me.confuser.barapi.BarAPI
的用法示例。
在下文中一共展示了BarAPI.removeBar方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: backToNormal
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
public void backToNormal(Player player) {
PlayerStuff playerStuff = playerStuffMap.remove(player);
players.remove(player);
if (!playerStuff.allowFlight && player.isFlying()) {
player.setFlying(false);
}
player.setAllowFlight(playerStuff.allowFlight);
player.setGameMode(playerStuff.gameMode);
player.getInventory().setContents(playerStuff.inventory.getContents());
player.updateInventory();
for (PotionEffect effect : player.getActivePotionEffects()) {
player.removePotionEffect(effect.getType());
}
plugin.sm.removeScoreboard(player);
BarAPI.removeBar(player);
}
示例2: setMessage
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
@Override
public void setMessage(Player player, SkillType skill, String newMessage, float percent) {
String oldMessage = BarAPI.getMessage(player);
if (!newMessage.equals(oldMessage)) {
//if the player level ups the message would be different.
//BarPluginApi doesn't update the message if the player already has a bar
BarAPI.removeBar(player);
}
BarAPI.setMessage(player, newMessage, percent);
lastSkillType = skill;
}
示例3: playerswitchworld
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
@EventHandler
public void playerswitchworld(PlayerChangedWorldEvent e){
if(e.getFrom().equals(Bukkit.getWorld("Hub"))){
BarAPI.removeBar(e.getPlayer());
bartask.get(e.getPlayer()).cancel();
bartask.remove(e.getPlayer());
}
if(e.getFrom().equals(Bukkit.getWorld("MG"))){
BarAPI.removeBar(e.getPlayer());
doBar(e.getPlayer());
}
}
示例4: onGameLeave
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
@EventHandler
public void onGameLeave(GameLeaveEvent event) {
Game game = game(event);
if (game == null) {
return;
}
Player p = event.getPlayer();
FFAParticipants state = (FFAParticipants) game.getParticipants();
// Kills check
boolean failedKillsCheck = game.getStats().getKillCount(p) == 0;
// Distance check
boolean failedDistanceCheck = false;
for (Player player : state.getPlayers()) {
if (p.getWorld().equals(player.getWorld()) && p.getLocation().distanceSquared(player.getLocation()) < 20 * 20) {
failedDistanceCheck = true;
break;
}
}
if (failedKillsCheck) {
game.getGameplay().sendGameMessage(p, "You must kill at least one person before leaving!");
}
if (failedDistanceCheck) {
game.getGameplay().sendGameMessage(p, "You must be at least 20 blocks away from another player!");
}
if (failedKillsCheck || failedDistanceCheck) {
event.setCancelled(true);
return;
}
if (barAPI) {
BarAPI.removeBar(p);
}
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "spawn " + p.getName());
}
示例5: onGameQuit
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
@EventHandler
public void onGameQuit(GameQuitEvent event) {
Game game = game(event);
if (game == null) {
return;
}
if (barAPI) {
BarAPI.removeBar(event.getPlayer());
}
Player p = event.getPlayer();
p.setGameMode(GameMode.SURVIVAL);
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "spawn " + p.getName());
}
示例6: setBossBarAll
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
/**
* Set's boss bar content for all players.
*
* @param replace
* message (max 40 char.)
*/
public void setBossBarAll(final String message) {
for (Player p : this.activePlayers) {
BarAPI.removeBar(p);
BarAPI.setMessage(p, message);
}
}
示例7: onPlayerLeft
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
/**
* Called when player left the arena. If is arena in LOBBY/WAITING_PLAYERS state, and flag
* {@link AdvancedArena#countdownCanCancel} is set to <b>true</b>, stops the countdown.
*/
@Override
public void onPlayerLeft(final Player player, final DisconnectReason reason) {
super.onPlayerLeft(player, reason);
this.chatAll(ChatManager.minigame(this.getMinigame(),
"Player '" + player.getName() + "' has left arena (" + reason.name()
+ ")!"));
NetworkCCFormatter.sendPlayerLeft(this, player);
this.tryStopCountdown();
this.checkForEnd();
// BarApi fix.
if (BarAPI.hasBar(player))
BarAPI.removeBar(player);
// Alway remove from spectating mode.
if (this.isSpectating(player)) {
this.setSpectating(player, false);
}
this.updateGameState();
// Clear player's inventory.
this.clearPlayerInventory(player);
}
示例8: removeBar
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
public static void removeBar(Player player) {
try {
if (Bukkit.getPluginManager().getPlugin("BarAPI") != null) {
BarAPI.removeBar(player);
}
} catch (Throwable t) {
}
}
示例9: removeBar
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
@Override
public void removeBar(Player player, SkillType skill) {
if (lastSkillType == skill) {
BarAPI.removeBar(player);
}
}
示例10: removeAllBars
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
@Override
public void removeAllBars(Player player) {
BarAPI.removeBar(player);
}
示例11: leave
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
public static void leave(Player p) {
// if (BlockParty.onFloorPlayers.containsKey(p.getName())) {
// p.sendMessage(BlockParty.messageManager.LEAVE_CANNOT);
// return;
// }
if (!BlockParty.inGamePlayers.containsKey(p.getName())) {
BlockParty.inventoryManager.restoreInv(p);
BlockParty.inventoriesToRestore.remove(p.getPlayer().getName());
p.sendMessage(BlockParty.messageManager.LEAVE_NOT_IN_ARENA);
return;
}
// Remove player from lobby since they left
BlockParty.inLobbyPlayers.remove(p.getName());
BlockParty.inGamePlayers.remove(p.getName());
BlockParty.onFloorPlayers.remove(p.getName());
broadcastInGame(BlockParty.messageManager.LEAVE_ARENA_BROADCAST.replace("$PLAYER$", p.getName()), (String) BlockParty.inGamePlayers.get(p.getName()));
if (BlockParty.getArena.get(arenaName) != null) {
if ((Bukkit.getPluginManager().isPluginEnabled("NoteBlockAPI")) && (((Config) BlockParty.getArena.get(arenaName)).getUseSongs())) {
Songs.stop(p);
}
} else {
if ((Bukkit.getPluginManager().isPluginEnabled("NoteBlockAPI"))) {
Songs.stop(p);
}
}
p.teleport((Location) BlockParty.locs.get(p.getName()));
BlockParty.locs.remove(p.getName());
// Due to 1.8 glitch we have to force gamemode or they cant break blocks
// when they leave arena.
p.setGameMode(GameMode.SURVIVAL);
// p.setGameMode((GameMode) BlockParty.gm.get(p.getName()));
BlockParty.gm.remove(p.getName());
BlockParty.inventoryManager.restoreInv(p);
BlockParty.inventoriesToRestore.remove(p.getPlayer().getName());
if (Bukkit.getPluginManager().isPluginEnabled("BarAPI")) {
BarAPI.removeBar(p);
}
p.sendMessage(BlockParty.messageManager.LEAVE_ARENA_PLAYER);
return;
}
示例12: removeBar
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
@Override
public void removeBar(Player player) {
BarAPI.removeBar(player);
}
示例13: leave
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
public static void leave(Player p) {
// if (BlockParty.onFloorPlayers.containsKey(p.getName())) {
// p.sendMessage(BlockParty.messageManager.LEAVE_CANNOT);
// return;
// }
if (!BlockParty.inGamePlayers.containsKey(p.getName())) {
BlockParty.inventoryManager.restoreInv(p);
BlockParty.inventoriesToRestore.remove(p.getPlayer().getName());
p.sendMessage(BlockParty.messageManager.LEAVE_NOT_IN_ARENA);
return;
}
// Remove player from lobby since they left
BlockParty.inLobbyPlayers.remove(p.getName());
BlockParty.inGamePlayers.remove(p.getName());
BlockParty.onFloorPlayers.remove(p.getName());
//Scoreboard
ScoreboardSys.removeScore(p);
broadcastInGame(BlockParty.messageManager.LEAVE_ARENA_BROADCAST.replace("$PLAYER$", p.getName()), (String) BlockParty.inGamePlayers.get(p.getName()));
if (BlockParty.getArena.get(arenaName) != null) {
if ((Bukkit.getPluginManager().isPluginEnabled("NoteBlockAPI")) && (((Config) BlockParty.getArena.get(arenaName)).getUseSongs())) {
Songs.stop(p);
}
} else {
if ((Bukkit.getPluginManager().isPluginEnabled("NoteBlockAPI"))) {
Songs.stop(p);
}
}
p.teleport((Location) BlockParty.locs.get(p.getName()));
BlockParty.locs.remove(p.getName());
// Due to 1.8 glitch we have to force gamemode or they cant break blocks
// when they leave arena.
p.setGameMode(GameMode.SURVIVAL);
// p.setGameMode((GameMode) BlockParty.gm.get(p.getName()));
BlockParty.gm.remove(p.getName());
BlockParty.inventoryManager.restoreInv(p);
BlockParty.inventoriesToRestore.remove(p.getPlayer().getName());
if (Bukkit.getPluginManager().isPluginEnabled("BarAPI")) {
BarAPI.removeBar(p);
}
p.sendMessage(BlockParty.messageManager.LEAVE_ARENA_PLAYER);
return;
}
示例14: onGameUnspectate
import me.confuser.barapi.BarAPI; //导入方法依赖的package包/类
@EventHandler(priority = EventPriority.MONITOR)
public void onGameUnspectate(GameUnspectateEvent event) {
if (barAPI) {
BarAPI.removeBar(event.getPlayer());
}
}