- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Connection c =
DataSource dataSource;dataSource.getConnection()
String url;DriverManager.getConnection(url)
IdentityDatabaseUtil.getDBConnection()
- Smart code suggestions by Codota
}
@EventHandler public void onPlayerDeath(PlayerDeathEvent event) { Hologram hologram = HologramsAPI.createHologram(this, event.getEntity().getEyeLocation()); hologram.appendTextLine(ChatColor.RED + "Player " + ChatColor.GOLD + event.getEntity().getName() + ChatColor.RED + " died here!"); hologram.appendTextLine(ChatColor.GRAY + "Time of death: " + new SimpleDateFormat("H:m").format(new Date())); } }
@Override public void onInit() { if (Bukkit.getPluginManager().getPlugin("HolographicDisplays") == null) { markAsErroneous("HolographicDisplays not enabled"); return; } getSign().getBlock().setType(VanillaItem.AIR.getMaterial()); String[] holoLines = lines[1].split("/"); Location location = getSign().getLocation(); location = location.add(0.5, NumberUtil.parseDouble(lines[2]), 0.5); hologram = HologramsAPI.createHologram(plugin, location); for (String line : holoLines) { if (line.startsWith("Item:")) { String id = line.replace("Item:", ""); ItemStack item = null; ExItem exItem = plugin.getCaliburn().getExItem(id); if (exItem != null) { item = exItem.toItemStack(); } hologram.appendItemLine(item); } else { hologram.appendTextLine(ChatColor.translateAlternateColorCodes('&', line)); } } }
hologram.appendTextLine(ChatColor.AQUA + "" + ChatColor.BOLD + "Speed PowerUp"); ItemLine icon = hologram.appendItemLine(new ItemStack(Material.SUGAR));
public DGroupTag(DungeonsXL plugin, DGamePlayer player) { this.player = player; DGroup group = player.getDGroup(); if (group != null) { hologram = HologramsAPI.createHologram(plugin, player.getPlayer().getLocation().clone().add(0, 3.5, 0)); hologram.appendItemLine(group.getDColor().getWoolMaterial().toItemStack()); hologram.appendTextLine(group.getName()); } }
hologram.appendItemLine(new ItemStack(Material.matchMaterial(line.substring(5)))); } else { hologram.appendTextLine(line.replace('&', '§'));
hologram.appendItemLine(new ItemStack(Material.matchMaterial(line.substring(5)))); } else { hologram.appendTextLine(line.replace('&', '§'));
TextLine textLine = holo.appendTextLine(line); textLine.setTouchHandler(new TouchHandler() {
TextLine textLine = holo.appendTextLine(line); textLine.setTouchHandler(new TouchHandler() {