本文整理汇总了Java中org.kitteh.tag.TagAPI类的典型用法代码示例。如果您正苦于以下问题:Java TagAPI类的具体用法?Java TagAPI怎么用?Java TagAPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TagAPI类属于org.kitteh.tag包,在下文中一共展示了TagAPI类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: disguise
import org.kitteh.tag.TagAPI; //导入依赖的package包/类
public boolean disguise(Player player, String teamName) {
if (!isValid(teamName)) {
return false;
}
Team team = teams.get(teamName);
ItemStack tshirt = new ItemStack(Material.LEATHER_CHESTPLATE);
LeatherArmorMeta tShirtMeta = (LeatherArmorMeta) tshirt.getItemMeta();
tShirtMeta.setColor(team.tshirtColor);
tShirtMeta.setDisplayName(team.chatColor + team.tshirtName);
backToNormal(player, false);
player.setDisplayName(team.chatColor + player.getName());
tshirt.setItemMeta(tShirtMeta);
player.getInventory().setChestplate(tshirt);
player.setGameMode(GameMode.ADVENTURE);
TagAPI.refreshPlayer(player);
_disguisedPlayers_mutex.lock();
try {
disguisedPlayers.put(player, team);
} finally {
_disguisedPlayers_mutex.unlock();
}
score.scoreTeams.get(teamName).addPlayer(player);
updateScoreboards();
return true;
}
开发者ID:ddonofrio,项目名称:libelula,代码行数:26,代码来源:TeamManager.java
示例2: run
import org.kitteh.tag.TagAPI; //导入依赖的package包/类
@Override
public void run() {
try {
Player player = CivGlobal.getPlayer(playerToUpdate);
for (Resident resident : residentsToSendUpdate) {
try {
Player resPlayer = CivGlobal.getPlayer(resident);
if (player == resPlayer) {
continue;
}
TagAPI.refreshPlayer(player, resPlayer);
TagAPI.refreshPlayer(resPlayer, player);
} catch (CivException e) {
// one of these players is not online.
}
}
} catch (CivException e1) {
return;
}
}
开发者ID:netizen539,项目名称:civcraft,代码行数:24,代码来源:SyncUpdateTags.java
示例3: reload
import org.kitteh.tag.TagAPI; //导入依赖的package包/类
/**
* Reloads all the player tags on the server.
* Useful if the tags have changed in the configuration
*
* Only refreshes nearby players that are visible (and not all player's in
* that world) to improve security against hacked clients.
*
* @param plugin plugin with possible TagAPI
*/
public static void reload(Plugin plugin) {
if (isEnabled(plugin)) {
final int maxPlayerViewDistance = plugin.getServer().getViewDistance() * CHUNK_WIDTH;
for (Player player : plugin.getServer().getOnlinePlayers()) {
final int maxWorldHeight = player.getWorld().getMaxHeight();
final Set<Player> tagsToUpdate = new HashSet<>();
final List<Entity> nearbyEntities = player.getNearbyEntities(maxPlayerViewDistance, maxWorldHeight, maxPlayerViewDistance);
for (Entity e : nearbyEntities) {
if (e instanceof Player) {
final Player p = (Player) e;
if (player.canSee(p)) {
tagsToUpdate.add(p);
}
}
}
if (!tagsToUpdate.isEmpty()) {
TagAPI.refreshPlayer(player, tagsToUpdate);
}
}
}
}
开发者ID:JamesHealey94,项目名称:SimplePVPToggle,代码行数:34,代码来源:TagUtils.java
示例4: onEnable
import org.kitteh.tag.TagAPI; //导入依赖的package包/类
@Override
public void onEnable() {
//TODO Implement Handlers
//Compatibility with TabAPI and TagAPI
tabApi = new TabAPI(this);
tagApi = new TagAPI(this);
}
开发者ID:TechzoneMC,项目名称:TagTabAPI,代码行数:9,代码来源:TagTabAPI.java
示例5: backToNormal
import org.kitteh.tag.TagAPI; //导入依赖的package包/类
private void backToNormal(Player player, boolean reset) {
_disguisedPlayers_mutex.lock();
Team team = null;
try {
team = disguisedPlayers.remove(player);
} finally {
_disguisedPlayers_mutex.unlock();
}
ItemStack air = new ItemStack(Material.AIR);
player.setFoodLevel(20);
player.setHealth(20);
player.setFlying(false);
player.getInventory().clear();
player.getInventory().setBoots(air);
player.getInventory().setHelmet(air);
player.getInventory().setLeggings(air);
if (team != null) {
score.scoreTeams.get(team.name).removePlayer(player);
}
for (PotionEffect effect : player.getActivePotionEffects())
player.removePotionEffect(effect.getType());
if (reset == true) {
player.setDisplayName(player.getName());
player.setGameMode(GameMode.SURVIVAL);
TagAPI.refreshPlayer(player);
player.getInventory().setChestplate(air);
updateScoreboards();
}
}
开发者ID:ddonofrio,项目名称:libelula,代码行数:32,代码来源:TeamManager.java
示例6: f5
import org.kitteh.tag.TagAPI; //导入依赖的package包/类
public static void f5(Player p) {
if (!$.nil(instance)) {
TagAPI.refreshPlayer(p);
}
}
开发者ID:caoli5288,项目名称:nick,代码行数:6,代码来源:TagExecutor.java
示例7: onStopTrading
import org.kitteh.tag.TagAPI; //导入依赖的package包/类
@EventHandler
public void onStopTrading(TradingStopEvent ev) {
if (plugin.getServer().getPluginManager().getPlugin("TagAPI") != null) {
TagAPI.refreshPlayer(ev.getTrader().getPlayer());
}
}
开发者ID:ase34,项目名称:itemtrader,代码行数:7,代码来源:ItemTraderListener.java
示例8: onStartTrading
import org.kitteh.tag.TagAPI; //导入依赖的package包/类
@EventHandler
public void onStartTrading(TradingStartEvent ev) {
if (plugin.getServer().getPluginManager().getPlugin("TagAPI") != null) {
TagAPI.refreshPlayer(ev.getTrader().getPlayer());
}
}
开发者ID:ase34,项目名称:itemtrader,代码行数:7,代码来源:ItemTraderListener.java
示例9: refreshPlayer
import org.kitteh.tag.TagAPI; //导入依赖的package包/类
/**
* If TagAPI is enabled, then refresh player tag.
*
* @param player player with tag to refresh
* @param plugin plugin with possible TagAPI
*/
public static void refreshPlayer(Player player, Plugin plugin) {
if (isEnabled(plugin)) {
TagAPI.refreshPlayer(player);
}
}
开发者ID:JamesHealey94,项目名称:SimplePVPToggle,代码行数:12,代码来源:TagUtils.java
注:本文中的org.kitteh.tag.TagAPI类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论