@Override public String toString() { return getColor() + " " + super.toString(); }
@Override public boolean matches(BlockStateData state, Wool data) throws InvalidBlockStateException { if (state.contains("color")) { DyeColor color = StateSerialization.getColor(state.get("color")); if (color == null) { throw new InvalidBlockStateException(data.getItemType(), state); } return data.getColor() == color; } return true; } }
@Override public String toString() { return getColor() + " " + super.toString(); }
DGroup dGroup = getDGroupByButton(button); DGroup pGroup = DGroup.getByPlayer(player); DColor color = DColor.getByDyeColor(((Wool) button.getData()).getColor());
private void onLobbyInventoryClick(InventoryClickEvent ice, Player player, Game game) { Inventory inv = ice.getInventory(); ItemStack clickedStack = ice.getCurrentItem(); if (!inv.getTitle().equals(BedwarsRel._l(player, "lobby.chooseteam"))) { ice.setCancelled(true); return; } if (clickedStack == null) { ice.setCancelled(true); return; } if (clickedStack.getType() != Material.WOOL) { ice.setCancelled(true); return; } ice.setCancelled(true); Wool wool = (Wool) clickedStack.getData(); Team team = game.getTeamByDyeColor(wool.getColor()); if (team == null) { return; } game.playerJoinTeam(player, team); player.closeInventory(); }
private void onLobbyInventoryClick(InventoryClickEvent ice, Player player, Game game) { Inventory inv = ice.getInventory(); ItemStack clickedStack = ice.getCurrentItem(); if (!inv.getTitle().equals(BedwarsRel._l(player, "lobby.chooseteam"))) { ice.setCancelled(true); return; } if (clickedStack == null) { ice.setCancelled(true); return; } if (clickedStack.getType() != Material.WOOL) { ice.setCancelled(true); return; } ice.setCancelled(true); Wool wool = (Wool) clickedStack.getData(); Team team = game.getTeamByDyeColor(wool.getColor()); if (team == null) { return; } game.playerJoinTeam(player, team); player.closeInventory(); }