Java Code Examples for org.bukkit.Material#SLIME_BALL
The following examples show how to use
org.bukkit.Material#SLIME_BALL .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PlayerStorage.java From BedwarsRel with GNU General Public License v3.0 | 5 votes |
public void loadLobbyInventory(Game game) { ItemMeta im = null; // choose team only when autobalance is disabled if (!game.isAutobalanceEnabled()) { // Choose team (Wool) ItemStack teamSelection = new ItemStack(Material.BED, 1); im = teamSelection.getItemMeta(); im.setDisplayName(BedwarsRel._l(this.player, "lobby.chooseteam")); teamSelection.setItemMeta(im); this.player.getInventory().addItem(teamSelection); } // Leave game (Slimeball) ItemStack leaveGame = new ItemStack(Material.SLIME_BALL, 1); im = leaveGame.getItemMeta(); im.setDisplayName(BedwarsRel._l(this.player, "lobby.leavegame")); leaveGame.setItemMeta(im); this.player.getInventory().setItem(8, leaveGame); if ((this.player.hasPermission("bw.setup") || this.player.isOp() || this.player.hasPermission("bw.vip.forcestart")) || (game.getGameLobbyCountdown() != null && (this.player.hasPermission("bw.setup") || this.player.isOp() || this.player.hasPermission("bw.vip.forcestart")))) { this.addGameStartItem(); } if (game.getGameLobbyCountdown() != null && game.getGameLobbyCountdown().getLobbytime() > game.getGameLobbyCountdown() .getLobbytimeWhenFull() && (this.player.hasPermission("bw.setup") || this.player.isOp() || this.player.hasPermission("bw.vip.reducecountdown"))) { this.addReduceCountdownItem(); } this.player.updateInventory(); }
Example 2
Source File: Game.java From BedwarsRel with GNU General Public License v3.0 | 4 votes |
public void toSpectator(Player player) { final Player p = player; if (!this.freePlayers.contains(player)) { this.freePlayers.add(player); } PlayerStorage storage = this.getPlayerStorage(player); if (storage != null) { storage.clean(); } else { storage = this.addPlayerStorage(player); storage.store(); storage.clean(); } final Location location = this.getPlayerTeleportLocation(p); if (!p.getLocation().getWorld().equals(location.getWorld())) { this.getPlayerSettings(p).setTeleporting(true); if (BedwarsRel.getInstance().isBungee()) { new BukkitRunnable() { @Override public void run() { p.teleport(location); } }.runTaskLater(BedwarsRel.getInstance(), 10L); } else { p.teleport(location); } } new BukkitRunnable() { @Override public void run() { Game.this.setPlayerGameMode(p); Game.this.setPlayerVisibility(p); } }.runTaskLater(BedwarsRel.getInstance(), 15L); // Leave game (Slimeball) ItemStack leaveGame = new ItemStack(Material.SLIME_BALL, 1); ItemMeta im = leaveGame.getItemMeta(); im.setDisplayName(BedwarsRel._l(player, "lobby.leavegame")); leaveGame.setItemMeta(im); p.getInventory().setItem(8, leaveGame); if (this.getCycle() instanceof BungeeGameCycle && this.getCycle().isEndGameRunning() && BedwarsRel.getInstance().getBooleanConfig("bungeecord.endgame-in-lobby", true)) { p.updateInventory(); return; } // Teleport to player (Compass) ItemStack teleportPlayer = new ItemStack(Material.COMPASS, 1); im = teleportPlayer.getItemMeta(); im.setDisplayName(BedwarsRel._l(p, "ingame.spectate")); teleportPlayer.setItemMeta(im); p.getInventory().setItem(0, teleportPlayer); p.updateInventory(); this.updateScoreboard(); }
Example 3
Source File: NewItemShop.java From BedwarsRel with GNU General Public License v3.0 | 4 votes |
private void handleCategoryInventoryClick(InventoryClickEvent ice, Game game, Player player) { int catSize = this.getCategoriesSize(player); int sizeCategories = this.getInventorySize(catSize) + 9; int rawSlot = ice.getRawSlot(); if (rawSlot >= this.getInventorySize(catSize) && rawSlot < sizeCategories) { ice.setCancelled(true); if (ice.getCurrentItem().getType() == Material.SLIME_BALL) { this.changeToOldShop(game, player); return; } if (ice.getCurrentItem().getType() == Material.BUCKET) { game.getPlayerSettings(player).setOneStackPerShift(false); player.playSound(player.getLocation(), SoundMachine.get("CLICK", "UI_BUTTON_CLICK"), Float.valueOf("1.0"), Float.valueOf("1.0")); this.openCategoryInventory(player); return; } else if (ice.getCurrentItem().getType() == Material.LAVA_BUCKET) { game.getPlayerSettings(player).setOneStackPerShift(true); player.playSound(player.getLocation(), SoundMachine.get("CLICK", "UI_BUTTON_CLICK"), Float.valueOf("1.0"), Float.valueOf("1.0")); this.openCategoryInventory(player); return; } } if (rawSlot >= sizeCategories) { if (ice.isShiftClick()) { ice.setCancelled(true); return; } ice.setCancelled(false); return; } MerchantCategory clickedCategory = this.getCategoryByMaterial(ice.getCurrentItem().getType()); if (clickedCategory == null) { if (ice.isShiftClick()) { ice.setCancelled(true); return; } ice.setCancelled(false); return; } this.openBuyInventory(clickedCategory, player, game); }