当前位置: 首页>>代码示例>>Java>>正文


Java HologramsAPI类代码示例

本文整理汇总了Java中com.gmail.filoghost.holographicdisplays.api.HologramsAPI的典型用法代码示例。如果您正苦于以下问题:Java HologramsAPI类的具体用法?Java HologramsAPI怎么用?Java HologramsAPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


HologramsAPI类属于com.gmail.filoghost.holographicdisplays.api包,在下文中一共展示了HologramsAPI类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateHomeHologram

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
/**
 * Updates the home hologram
 */
public void updateHomeHologram() {
    if (!fConfig.areHologramsEnabled() || !active) {
        return;
    }
    // Run this 1 tick later sothat everything is loaded
    final Faction faction = this;
    new BukkitRunnable() {
        @Override
        public void run() {
            if (homeHolo != null) {
                homeHolo.delete();
            }
            homeHolo = HologramsAPI.createHologram(plugin, getHome().clone().add(0, 3, 0));
            homeHolo.appendItemLine(getBannerStack());
            for (String line : fConfig.getHomeHologramText()) {
                homeHolo.appendTextLine(ParsingUtil.replaceFactionPlaceholders(line, faction));
            }
        }
    }.runTaskLater(plugin, 1L);
}
 
开发者ID:DRE2N,项目名称:FactionsXL,代码行数:24,代码来源:Faction.java

示例2: getClosest

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
public static Hologram getClosest(Player player) {
	if (!Bukkit.getPluginManager().isPluginEnabled("HolographicDisplays"))
		return null;
	Collection<Hologram> holos = HologramsAPI.getHolograms(PluginLoader.getInstance());
	Hologram closest = null;
	double lowestDist = Double.MAX_VALUE;

	for (Hologram holo : holos) {
		double dist = holo.getLocation().distance(player.getLocation());
		if (dist < lowestDist) {
			lowestDist = dist;
			closest = holo;
		}
	}
	return closest;
}
 
开发者ID:KWStudios,项目名称:RageMode,代码行数:17,代码来源:HoloHolder.java

示例3: loadHolos

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
public static void loadHolos() {
	if (!Bukkit.getPluginManager().isPluginEnabled("HolographicDisplays"))
		return;
	Collection<Hologram> holos = HologramsAPI.getHolograms(PluginLoader.getInstance());
	for (Hologram holo : holos) {
		holo.delete();
	}
	Collection<? extends Player> onlines = Bukkit.getOnlinePlayers();
	for (Player player : onlines) {
		showAllHolosToPlayer(player);
	}
}
 
开发者ID:KWStudios,项目名称:RageMode,代码行数:13,代码来源:HoloHolder.java

示例4: deleteHoloObjectsOfPlayer

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
public static void deleteHoloObjectsOfPlayer(Player player) {
	if (!Bukkit.getPluginManager().isPluginEnabled("HolographicDisplays"))
		return;
	Collection<Hologram> holos = HologramsAPI.getHolograms(PluginLoader.getInstance());
	for (Hologram holo : holos) {
		if (holo.getVisibilityManager().isVisibleTo(player))
			holo.delete();
	}
}
 
开发者ID:KWStudios,项目名称:RageMode,代码行数:10,代码来源:HoloHolder.java

示例5: createPlayerStatisticHologram

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
private Hologram createPlayerStatisticHologram(Player player, Location holoLocation) {
  final Hologram holo = HologramsAPI.createHologram(BedwarsRel.getInstance(), holoLocation);
  holo.getVisibilityManager().setVisibleByDefault(false);
  holo.getVisibilityManager().showTo(player);

  this.updatePlayerStatisticHologram(player, holo);
  return holo;
}
 
开发者ID:BedwarsRel,项目名称:BedwarsRel,代码行数:9,代码来源:HolographicDisplaysInteraction.java

示例6: unloadHolograms

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
public void unloadHolograms() {
  if (BedwarsRel.getInstance().isHologramsEnabled()) {
    Iterator<Hologram> iterator = HologramsAPI.getHolograms(BedwarsRel.getInstance()).iterator();
    while (iterator.hasNext()) {
      iterator.next().delete();
    }
  }
}
 
开发者ID:BedwarsRel,项目名称:BedwarsRel,代码行数:9,代码来源:HolographicDisplaysInteraction.java

示例7: spawnNPCs

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
public static void spawnNPCs(){
    Entity pet = Bukkit.getWorld(world).spawnEntity(new Location(Bukkit.getWorld(world), -1249, 55, 242, -120, 0).add(0.5, 0, 0.5), EntityType.VILLAGER);
    EntityUtils.noAI(pet);
    entitys.add(pet);

    Hologram petHolo = HologramsAPI.createHologram(Main.getPlugin(), pet.getLocation().add(0, 2.6, 0));
    petHolo.appendTextLine(MiscUtils.color("&bPet Shop"));
    petHolo.appendTextLine(MiscUtils.color("&7&lSoonTM"));
    holograms.add(petHolo);

    Entity merchant = Bukkit.getWorld(world).spawnEntity(new Location(Bukkit.getWorld(world), -1197, 54, 59, -15, 0).add(0.5, 0, 0.5), EntityType.VILLAGER);
    EntityUtils.noAI(merchant);
    entitys.add(merchant);

    Hologram merchantHolo = HologramsAPI.createHologram(Main.getPlugin(), merchant.getLocation().add(0, 2.6, 0));
    merchantHolo.appendTextLine(MiscUtils.color("&bKleding Shop"));
    merchantHolo.appendTextLine(MiscUtils.color("&7&lSoonTM"));
    holograms.add(merchantHolo);

    Entity gadget = Bukkit.getWorld(world).spawnEntity(new Location(Bukkit.getWorld(world), -1249, 55, 238, -50, 0).add(0.5,0,0.5), EntityType.VILLAGER);
    gadgetEntity = gadget;
    EntityUtils.noAI(gadget);
    entitys.add(gadget);

    Hologram gadgetHolo = HologramsAPI.createHologram(Main.getPlugin(), gadget.getLocation().add(0, 2.6, 0));
    gadgetHolo.appendTextLine(MiscUtils.color("&bGadget Shop"));
    gadgetHolo.appendTextLine(MiscUtils.color("&a&lRIGHT CLICK"));
    holograms.add(gadgetHolo);

    Entity food = Bukkit.getWorld(world).spawnEntity(new Location(Bukkit.getWorld(world), -1184, 54, 60, -180, 0).add(0.5,0,0.5), EntityType.VILLAGER);
    EntityUtils.noAI(food);
    entitys.add(food);

    Hologram foodHolo = HologramsAPI.createHologram(Main.getPlugin(), food.getLocation().add(0, 2.6, 0));
    foodHolo.appendTextLine(MiscUtils.color("&bCocktail Bar"));
    foodHolo.appendTextLine(MiscUtils.color("&7&lSoonTM"));
    holograms.add(foodHolo);
}
 
开发者ID:Cooltimmetje,项目名称:PretparkCore,代码行数:39,代码来源:NpcManager.java

示例8: create

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
/**
 * Creates a Hologram Checkpoint. The checkpoint will
 * display as inactive until a Zombie comes close enough.
 *
 * @param plugin the plugin instance
 */
public void create(Plugin plugin) {
    activated = false;
    if (hologram == null) {
        hologram = HologramsAPI.createHologram(plugin, location);
        hologram.appendTextLine(Utils.color("&a&lCHECKPOINT #" + id));
        hologram.appendTextLine(Utils.color("Not Active"));
    } else {
        hologram.removeLine(1);
        hologram.appendTextLine("Not Active");
    }
}
 
开发者ID:sgtcaze,项目名称:ZombieEscape,代码行数:18,代码来源:Checkpoint.java

示例9: appendVaultHologram

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
/**
 * Appends the vault hologram
 *
 * @param guild guild instance
 */
public void appendVaultHologram(NovaGuild guild) {
	if(Config.HOLOGRAPHICDISPLAYS_ENABLED.getBoolean()) {
		if(Config.VAULT_HOLOGRAM_ENABLED.getBoolean()) {
			checkVaultDestroyed(guild);
			if(guild.getVaultLocation() != null) {
				if(guild.getVaultHologram() == null) {
					Location hologramLocation = guild.getVaultLocation().clone();
					hologramLocation.add(0.5, 2, 0.5);
					Hologram hologram = HologramsAPI.createHologram(plugin, hologramLocation);
					hologram.getVisibilityManager().setVisibleByDefault(false);
					for(String hologramLine : Config.VAULT_HOLOGRAM_LINES.getStringList()) {
						if(hologramLine.startsWith("[ITEM]")) {
							hologramLine = hologramLine.substring(6);
							ItemStack itemStack = ItemStackUtils.stringToItemStack(hologramLine);
							if(itemStack != null) {
								hologram.appendItemLine(itemStack);
							}
						}
						else {
							hologram.appendTextLine(StringUtils.fixColors(hologramLine));
						}
					}

					guild.setVaultHologram(hologram);

					for(Player player : guild.getOnlinePlayers()) {
						guild.showVaultHologram(player);
					}
				}
			}
		}
	}
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:39,代码来源:GuildManager.java

示例10: create

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
public void create(Location location, Crate crate, ArrayList<String> lines) {
    com.gmail.filoghost.holographicdisplays.api.Hologram hologram = HologramsAPI.createHologram(crate.getCratesPlus(), location.clone().add(0, 1.25, 0));
    for (String line : lines) {
        hologram.appendTextLine(line);
    }
    holograms.put("" + location.getWorld().getName() + "|" + location.getBlockX() + "|" + location.getBlockY() + "|" + location.getBlockZ(), hologram);
}
 
开发者ID:ConnorLinfoot,项目名称:CratesPlus,代码行数:8,代码来源:HolographicDisplaysHologram.java

示例11: onDisable

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
@Override
public void onDisable() {
	if(FatalNovaGuildsException.fatal) {
		LoggerUtils.info("#" + VersionUtils.getBuildCurrent() + " (FATAL) Disabled");
		return;
	}

	getTaskManager().stopTasks();
	getGuildManager().save();
	getRegionManager().save();
	getPlayerManager().save();
	getRankManager().save();
	LoggerUtils.info("Saved all data");

	if(getPacketExtension() != null) {
		getPacketExtension().unregisterChannel();
	}

	if(getSignGUI() != null) {
		getSignGUI().destroy();
	}

	//remove boss bars
	if(Config.BOSSBAR_ENABLED.getBoolean()) {
		for(Player player : CompatibilityUtils.getOnlinePlayers()) {
			BossBarUtils.removeBar(player);
		}
	}

	//removing holograms
	if(Config.HOLOGRAPHICDISPLAYS_ENABLED.getBoolean()) {
		//Save holograms
		getHologramManager().save();

		for(Hologram h : HologramsAPI.getHolograms(this)) {
			h.delete();
		}
	}

	for(Player p : CompatibilityUtils.getOnlinePlayers()) {
		PlayerManager.getPlayer(p).cancelToolProgress();
	}

	for(NovaPlayer nPlayer : getPlayerManager().getPlayers()) {
		if(nPlayer.getActiveSelection() != null) {
			nPlayer.getActiveSelection().reset();
		}
	}

	LoggerUtils.info("#" + VersionUtils.getBuildCurrent() + " Disabled");
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:52,代码来源:NovaGuilds.java

示例12: create

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
@Override
public void create() {
	hologram = HologramsAPI.createHologram(NovaGuilds.getInstance(), location);
	refresh();
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:6,代码来源:NovaHologramImpl.java

示例13: execute

import com.gmail.filoghost.holographicdisplays.api.HologramsAPI; //导入依赖的package包/类
@Override
public void execute(CommandSender sender, String[] args) throws Exception {
	Message.CHAT_RELOAD_RELOADING.send(sender);

	//Remove holograms
	if(Config.HOLOGRAPHICDISPLAYS_ENABLED.getBoolean()) {
		for(Hologram h : HologramsAPI.getHolograms(plugin)) {
			h.delete();
		}
	}

	//plugin's vars from config
	plugin.getConfigManager().reload();
	Message.CHAT_RELOAD_CONFIG.send(sender);

	//Connecting to database
	plugin.setUpStorage();
	Message.CHAT_RELOAD_MYSQL.send(sender);

	//messages
	if(!plugin.getMessageManager().existsFile()) {
		Message.CHAT_RELOAD_NEWMSGFILE.send(sender);
	}

	plugin.getMessageManager().load();

	Message.CHAT_RELOAD_MESSAGES.send(sender);

	//guilds
	plugin.getGuildManager().load();
	Message.CHAT_RELOAD_GUILDS.send(sender);

	//regions
	plugin.getRegionManager().load();
	Message.CHAT_RELOAD_REGIONS.send(sender);

	//players
	plugin.getPlayerManager().load();
	Message.CHAT_RELOAD_PLAYERS.send(sender);

	//groups
	plugin.getGroupManager().load();
	Message.CHAT_RELOAD_GROUPS.send(sender);

	//ranks
	plugin.getRankManager().load();
	Message.CHAT_RELOAD_RANKS.send(sender);

	LoggerUtils.info("Post checks running");
	plugin.getGuildManager().postCheck();

	//all done
	Message.CHAT_RELOAD_RELOADED.send(sender);
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:55,代码来源:CommandAdminReload.java


注:本文中的com.gmail.filoghost.holographicdisplays.api.HologramsAPI类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。