• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Hologram类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: setHologramLines

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
private static void setHologramLines(Hologram hologram, RetPlayerPoints rpp) {
	if (rpp != null) {
		hologram.appendTextLine(ConstantHolder.RAGEMODE_PREFIX);
		hologram.appendTextLine(PluginLoader.getMessages().RANK + Integer.toString(rpp.getRank()));
		hologram.appendTextLine(PluginLoader.getMessages().SCORE + rpp.getPoints());
		hologram.appendTextLine(PluginLoader.getMessages().WINS + rpp.getWins());
		hologram.appendTextLine(PluginLoader.getMessages().GAMES + rpp.getGames());
		hologram.appendTextLine(PluginLoader.getMessages().KD + rpp.getKD());
		hologram.appendTextLine(PluginLoader.getMessages().KILLS + rpp.getKills());
		hologram.appendTextLine(PluginLoader.getMessages().DEATHS + rpp.getDeaths());
	} else {
		hologram.appendTextLine(ConstantHolder.RAGEMODE_PREFIX);
		hologram.appendTextLine(PluginLoader.getMessages().RANK + "---------------");
		hologram.appendTextLine(PluginLoader.getMessages().SCORE + "---------------");
		hologram.appendTextLine(PluginLoader.getMessages().WINS + "---------------");
		hologram.appendTextLine(PluginLoader.getMessages().GAMES + "---------------");
		hologram.appendTextLine(PluginLoader.getMessages().KD + "---------------");
		hologram.appendTextLine(PluginLoader.getMessages().KILLS + "---------------");
		hologram.appendTextLine(PluginLoader.getMessages().DEATHS + "---------------");
	}
}
 
开发者ID:KWStudios,项目名称:RageMode,代码行数:22,代码来源:HoloHolder.java


示例2: deleteHologram

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
public static void deleteHologram(Hologram holo) {
	if (!Bukkit.getPluginManager().isPluginEnabled("HolographicDisplays"))
		return;
	if (holo == null) {
		return;
	}

	List<Location> locList = (List<Location>) holosConfiguration.getList("data.holos");
	if (locList.contains(holo.getLocation()))
		locList.remove(holo.getLocation());

	holosConfiguration.set("data.holos", locList);

	try {
		holosConfiguration.save(yamlHolosFile);
	} catch (IOException e) {
		e.printStackTrace();
	}

	holo.delete();
	loadHolos();
}
 
开发者ID:KWStudios,项目名称:RageMode,代码行数:23,代码来源:HoloHolder.java


示例3: getClosest

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的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


示例4: updatePlayerHologram

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
private void updatePlayerHologram(Player player, Location holoLocation) {
  List<Hologram> holograms = null;
  if (!this.holograms.containsKey(player)) {
    this.holograms.put(player, new ArrayList<Hologram>());
  }

  holograms = this.holograms.get(player);
  Hologram holo = this.getHologramByLocation(holograms, holoLocation);
  if (holo == null && player.getWorld() == holoLocation.getWorld()) {
    holograms.add(this.createPlayerStatisticHologram(player, holoLocation));
  } else if (holo != null) {
    if (holo.getLocation().getWorld() == player.getWorld()) {
      this.updatePlayerStatisticHologram(player, holo);
    } else {
      holograms.remove(holo);
      holo.delete();
    }
  }
}
 
开发者ID:BedwarsRel,项目名称:BedwarsRel,代码行数:20,代码来源:HolographicDisplaysInteraction.java


示例5: followEntity

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
/**
 * Make a hologram follow an entity from the HoloManager by ID.
 * 
 * @param ent The entity to be followed.
 * @param id The ID text for the hologram.
 * @param xoffset The x offset of the hologram from the entity.
 * @param yoffset The y offset of the hologram from the entity.
 * @param zoffset The z offset of the hologram from the entity.
 */
public static void followEntity(final Entity ent, final String id, final double xoffset,
    final double yoffset, final double zoffset) {
  new BukkitRunnable() {
    @Override
    public void run() {
      Hologram hologram = getFromHoloMap(id);
      if (isInHoloMap(id) == true) {
        hologram.teleport(ent.getLocation().add(xoffset, yoffset, zoffset));
      } else {
        cancel();
      }
    }
  }.runTaskTimer(Core.plugin, 1L, 1L);

}
 
开发者ID:eyesniper2,项目名称:skRayFall,代码行数:25,代码来源:HoloManager.java


示例6: get

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
@Override
@Nullable
protected String[] get(Event evt) {
  if (HoloManager.getFromHoloMap(id.getSingle(evt).replace("\"", "")) != null) {
    Hologram hologram = HoloManager.getFromHoloMap(id.getSingle(evt).replace("\"", ""));
    String finalLine = hologram.getLine(line.getSingle(evt).intValue()).toString();
    if (finalLine.indexOf("text=") != -1) {
      finalLine = finalLine.substring(finalLine.indexOf("text=") + 5, finalLine.indexOf("]"));
      return new String[] {finalLine};
    } else if (finalLine.indexOf("itemStack=") != -1) {
      finalLine =
          finalLine.substring(finalLine.indexOf("itemStack=") + 10, finalLine.indexOf(","));
      return new String[] {finalLine};
    } else {
      return new String[] {null};
    }

  } else {
    return new String[] {null};
  }
}
 
开发者ID:eyesniper2,项目名称:skRayFall,代码行数:22,代码来源:ExprGetHoloLine.java


示例7: loadHolos

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的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


示例8: deleteHoloObjectsOfPlayer

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的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


示例9: createPlayerStatisticHologram

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的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


示例10: getHologramByLocation

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
private Hologram getHologramByLocation(List<Hologram> holograms, Location holoLocation) {
  for (Hologram holo : holograms) {
    if (holo.getLocation().getX() == holoLocation.getX()
        && holo.getLocation().getY() == holoLocation.getY()
        && holo.getLocation().getZ() == holoLocation.getZ()) {
      return holo;
    }
  }

  return null;
}
 
开发者ID:BedwarsRel,项目名称:BedwarsRel,代码行数:12,代码来源:HolographicDisplaysInteraction.java


示例11: loadHolograms

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void loadHolograms() {
  if (!BedwarsRel.getInstance().isHologramsEnabled()) {
    return;
  }

  if (this.holograms != null && this.hologramLocations != null) {
    // first unload all holograms
    this.unloadHolograms();
  }

  this.holograms = new HashMap<Player, List<Hologram>>();
  this.hologramLocations = new ArrayList<Location>();

  File file = new File(BedwarsRel.getInstance().getDataFolder(), "holodb.yml");
  if (file.exists()) {
    YamlConfiguration config = YamlConfiguration.loadConfiguration(file);
    List<Object> locations = (List<Object>) config.get("locations");
    for (Object location : locations) {
      Location loc = Utils.locationDeserialize(location);
      if (loc == null) {
        continue;
      }

      this.hologramLocations.add(loc);
    }
  }

  if (this.hologramLocations.size() == 0) {
    return;
  }

  this.updateHolograms();
}
 
开发者ID:BedwarsRel,项目名称:BedwarsRel,代码行数:35,代码来源:HolographicDisplaysInteraction.java


示例12: onHologramTouch

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
public void onHologramTouch(final Player player, final Hologram holo) {
  if (!player.hasMetadata("bw-remove-holo")
      || (!player.isOp() && !player.hasPermission("bw.setup"))) {
    return;
  }

  player.removeMetadata("bw-remove-holo", BedwarsRel.getInstance());
  BedwarsRel.getInstance().getServer().getScheduler()
      .runTask(BedwarsRel.getInstance(), new Runnable() {

        @Override
        public void run() {
          // remove all player holograms on this location
          for (Entry<Player, List<Hologram>> entry : HolographicDisplaysInteraction.this
              .getHolograms().entrySet()) {
            Iterator<Hologram> iterator = entry.getValue().iterator();
            while (iterator.hasNext()) {
              Hologram hologram = iterator.next();
              if (hologram.getX() == holo.getX() && hologram.getY() == holo.getY()
                  && hologram.getZ() == holo.getZ()) {
                hologram.delete();
                iterator.remove();
              }
            }
          }

          Location holoLocation =
              HolographicDisplaysInteraction.this
                  .getHologramLocationByLocation(holo.getLocation());
          if (holoLocation != null) {
            HolographicDisplaysInteraction.this.hologramLocations.remove(holoLocation);
            HolographicDisplaysInteraction.this.updateHologramDatabase();
          }
          player.sendMessage(
              ChatWriter.pluginMessage(ChatColor.GREEN + BedwarsRel._l("success.holoremoved")));
        }

      });
}
 
开发者ID:BedwarsRel,项目名称:BedwarsRel,代码行数:40,代码来源:HolographicDisplaysInteraction.java


示例13: unloadAllHolograms

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
public void unloadAllHolograms(Player player) {
  if (!this.holograms.containsKey(player)) {
    return;
  }

  for (Hologram holo : this.holograms.get(player)) {
    holo.delete();
  }

  this.holograms.remove(player);
}
 
开发者ID:BedwarsRel,项目名称:BedwarsRel,代码行数:12,代码来源:HolographicDisplaysInteraction.java


示例14: unloadHolograms

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的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


示例15: spawnNPCs

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的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


示例16: removeNPCs

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
public static void removeNPCs(){
    for(Hologram hologram : holograms){
        hologram.delete();
    }
    for(Entity entity : entitys){
        entity.remove();
    }
}
 
开发者ID:Cooltimmetje,项目名称:PretparkCore,代码行数:9,代码来源:NpcManager.java


示例17: appendVaultHologram

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的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


示例18: checkVaultDestroyed

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
/**
 * Fixes vault hologram and vault location
 * if it has been disabled abnormally
 *
 * @param guild guild instance
 */
public static void checkVaultDestroyed(NovaGuild guild) {
	if(guild.getVaultLocation() != null) {
		if(guild.getVaultLocation().getBlock().getType() != Material.CHEST) {
			guild.setVaultLocation(null);
			Hologram hologram = guild.getVaultHologram();

			if(hologram != null) {
				hologram.delete();
			}

			guild.setVaultHologram(null);
		}
	}
}
 
开发者ID:MarcinWieczorek,项目名称:NovaGuilds,代码行数:21,代码来源:GuildManager.java


示例19: execute

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
@Override
protected void execute(Event evt) {
  Hologram holo = HoloManager.removeFromHoloMap(id.getSingle(evt).replace("\"", ""));
  if (holo != null) {
    holo.delete();
  }
}
 
开发者ID:eyesniper2,项目名称:skRayFall,代码行数:8,代码来源:EffDeleteHoloObject.java


示例20: addToHoloMap

import com.gmail.filoghost.holographicdisplays.api.Hologram; //导入依赖的package包/类
/**
 * Store a hologram with an ID in the HoloManager.
 * 
 * @param id The ID text for the hologram.
 * @param holo The hologram object to be stored.
 */
public static boolean addToHoloMap(String id, Hologram holo) {
  if (holomap.containsKey(id)) {
    Skript.error("A hologram with the id " + id + " already exists!");
    return false;
  } else {
    holomap.put(id, holo);
    return true;
  }
}
 
开发者ID:eyesniper2,项目名称:skRayFall,代码行数:16,代码来源:HoloManager.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JobCommitFailedEvent类代码示例发布时间:2022-05-22
下一篇:
Java MockNodes类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap