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

Java TagAPI类代码示例

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

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java DummyReporter类代码示例发布时间:2022-05-22
下一篇:
Java ActiveMQException类代码示例发布时间: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