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


Java Type类代码示例

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


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

示例1: onPlayerDeath

import org.bukkit.BanList.Type; //导入依赖的package包/类
@EventHandler
public void onPlayerDeath( PlayerDeathEvent pEvent )
{
  Player tPlayer = pEvent.getEntity();
  if( tPlayer != null )
  {
    incDeathCounter( tPlayer );

    if( tPlayer.hasPermission( GTNH_PERM_FULL_MEMBER ) )
      return;

    int tDeathCount = getDeathCounter( tPlayer );
    if( tDeathCount >= _mMaxDeathCount )
    {
      Bukkit.getBanList( Type.NAME ).addBan( tPlayer.getName(), "Trial period expired. Contact an Admin", null, null );
      tPlayer.kickPlayer( ChatColor.translateAlternateColorCodes( '&', _mMain.mConfig.getString( "Messages.KickMessage" ) ) );
    }
    else
      tPlayer.sendMessage( ChatColor.translateAlternateColorCodes( '&', String.format( _mMain.mConfig.getString( "Messages.TrialWarning" ), tDeathCount, _mMaxDeathCount ) ) );
  }
}
 
开发者ID:GTNewHorizons,项目名称:NewHorizonsServerCore,代码行数:22,代码来源:TrialKick.java

示例2: getBanList

import org.bukkit.BanList.Type; //导入依赖的package包/类
@Override
public BanList getBanList(Type type)
{
	switch (type)
	{
		case IP:
			return playerList.getIPBans();
		case NAME:
		default:
			return playerList.getProfileBans();
	}
}
 
开发者ID:seeseemelk,项目名称:MockBukkit,代码行数:13,代码来源:ServerMock.java

示例3: getExpirationLong

import org.bukkit.BanList.Type; //导入依赖的package包/类
/**
 * Gets the expiration date from a ban entry.
 * 
 * @param target Target to get the expiration date from.
 * @return Returns the expiration date as a long in milliseconds.
 */
public long getExpirationLong(String target) {
	Validate.notNull(target, "Target cannot be null.");
	final BanEntry entry = Bukkit.getBanList(Type.NAME).getBanEntry(target);
	Validate.notNull(entry, "Cannot find BanList entry \"" + target + "\"");
	return entry.getExpiration().getTime();
}
 
开发者ID:NJDaeger,项目名称:EssentialCommands,代码行数:13,代码来源:BanAPI.java

示例4: getExpirationDate

import org.bukkit.BanList.Type; //导入依赖的package包/类
/**
 * Gets the expiration date from a ban entry.
 * 
 * @param target Target top get the expiration date from.
 * @return Returns the expiration date as a long in proper format.
 */
public Date getExpirationDate(String target) {
	Validate.notNull(target, "Target cannot be null.");
	final BanEntry entry = Bukkit.getBanList(Type.NAME).getBanEntry(target);
	Validate.notNull(entry, "Cannot find BanList entry \"" + target + "\"");
	return entry.getExpiration();
}
 
开发者ID:NJDaeger,项目名称:EssentialCommands,代码行数:13,代码来源:BanAPI.java

示例5: getReason

import org.bukkit.BanList.Type; //导入依赖的package包/类
/**
 * Gets the reason for the ban.
 * 
 * @param target The target to get the ban reason from.
 * @return Returns the reason for the ban.
 */
public String getReason(String target) {
	Validate.notNull(target, "Target cannot be null.");
	final BanEntry entry = Bukkit.getBanList(Type.NAME).getBanEntry(target);
	Validate.notNull(entry, "Cannot find BanList entry \"" + target + "\"");
	return entry.getReason();
}
 
开发者ID:NJDaeger,项目名称:EssentialCommands,代码行数:13,代码来源:BanAPI.java

示例6: isBanned

import org.bukkit.BanList.Type; //导入依赖的package包/类
/**
 * Checks if the BanList contains an entry.
 * 
 * @param target The target to find in the list.
 * @return True if list contains target, false otherwise.
 */
public boolean isBanned(String target) {
	Validate.notNull(target, "Target cannot be null.");
	final BanEntry entry = Bukkit.getBanList(Type.NAME).getBanEntry(target);
	if (entry == null) {
		return false;
	}
	return true;
}
 
开发者ID:NJDaeger,项目名称:EssentialCommands,代码行数:15,代码来源:BanAPI.java

示例7: processEvent

import org.bukkit.BanList.Type; //导入依赖的package包/类
public static void processEvent(Player player, String exploit) {
	if (!exploitData.containsKey(exploit.toLowerCase())) {
		exploitData.put(exploit.toLowerCase(), 0);
	}
	
	exploitData.put(exploit.toLowerCase(), Math.addExact(exploitData.get(exploit.toLowerCase()), 1));
	
	if (AntiExploit.config.getBoolean("AntiExploit.Exploits." + exploit + ".Broadcast") == true) {
		Bukkit.getServer().broadcastMessage(getMessage(player.getName(), exploit, "Broadcast"));
	}
	
	if (AntiExploit.config.getBoolean("AntiExploit.Exploits." + exploit + ".AlertStaff") == true) {
		for (Player onlineplayer : Bukkit.getOnlinePlayers()) {
			if (onlineplayer.hasPermission("AntiExploit.AlertStaff")) {
				onlineplayer.sendMessage(getMessage(player.getName(), exploit, "AlertStaff"));
			}
		}
	}
	
	if (AntiExploit.config.getDouble("AntiExploit.Exploits." + exploit + ".Damage") > 0D) {
		player.damage(AntiExploit.config.getDouble("AntiExploit.Exploits." + exploit + ".Damage"));
	}
	
	if (AntiExploit.config.getBoolean("AntiExploit.Exploits." + exploit + ".Ban") == true) {
		Bukkit.getBanList(Type.NAME).addBan(player.getName(), getMessage(player.getName(), exploit, "Ban"), null, "AntiExploit");
	}
	
	if (AntiExploit.config.getBoolean("AntiExploit.Exploits." + exploit + ".Ban") == true || AntiExploit.config.getBoolean("AntiExploit.Exploits." + exploit + ".Kick") == true) {
		player.kickPlayer(getMessage(player.getName(), exploit, "Kick"));
	}
	return;
}
 
开发者ID:LXGaming,项目名称:AntiExploit,代码行数:33,代码来源:ExploitManager.java

示例8: getIPBans

import org.bukkit.BanList.Type; //导入依赖的package包/类
public Set<String> getIPBans() {
    Set<String> ipBans = new HashSet<String>();

    for (BanEntry entry : this.getBanList(Type.IP).getBanEntries()) {
        ipBans.add(entry.getTarget());
    }

    return ipBans;
}
 
开发者ID:CanaryBukkitTeam,项目名称:CanaryBukkit,代码行数:10,代码来源:CanaryServer.java

示例9: isTempBanned

import org.bukkit.BanList.Type; //导入依赖的package包/类
@Override
public boolean isTempBanned() {
	if(Bukkit.getBanList(Type.NAME).isBanned(player)) {
		Date date = Bukkit.getServer().getBanList(Type.NAME).getBanEntry(player).getExpiration();
		if(date != null) {
			return true;
		} else {
			return false;
		}
	}
	return false;
}
 
开发者ID:xEssentials,项目名称:xEssentials-deprecated-bukkit,代码行数:13,代码来源:xEssentialsOfflinePlayer.java

示例10: setTempbanned

import org.bukkit.BanList.Type; //导入依赖的package包/类
@Override
public void setTempbanned(Long time, String reason, String who) {
	Date date = new Date(time);
	Bukkit.getServer().getBanList(Type.NAME).addBan(player, reason, date, who).save();
	con.set("tempbanned.isBanned", true);
	save();
}
 
开发者ID:xEssentials,项目名称:xEssentials-deprecated-bukkit,代码行数:8,代码来源:xEssentialsOfflinePlayer.java

示例11: isTempBanned

import org.bukkit.BanList.Type; //导入依赖的package包/类
@Override
public boolean isTempBanned() {
	if(Bukkit.getBanList(Type.NAME).isBanned(player.getName())) {
		Date date = Bukkit.getServer().getBanList(Type.NAME).getBanEntry(player.getName()).getExpiration();
		if(date != null) {
			return true;
		} else {
			return false;
		}
	}
	return false;
}
 
开发者ID:xEssentials,项目名称:xEssentials-deprecated-bukkit,代码行数:13,代码来源:xEssentialsPlayer.java

示例12: getBanList

import org.bukkit.BanList.Type; //导入依赖的package包/类
@Override
public BanList getBanList(Type arg0) {
	// TODO Auto-generated method stub
	return null;
}
 
开发者ID:netherrack,项目名称:netherrack,代码行数:6,代码来源:NetherServer.java

示例13: getBanList

import org.bukkit.BanList.Type; //导入依赖的package包/类
@Override
public BanList getBanList(Type type) {
	return null;
}
 
开发者ID:DevotedMC,项目名称:ExilePearl,代码行数:5,代码来源:TestServer.java

示例14: getBanList

import org.bukkit.BanList.Type; //导入依赖的package包/类
@Override
public BanList getBanList(Type arg0) {
	throw Pokkit.unsupported();

}
 
开发者ID:rutgerkok,项目名称:Pokkit,代码行数:6,代码来源:CraftServer.java

示例15: banIP

import org.bukkit.BanList.Type; //导入依赖的package包/类
public void banIP(String address) {
    Preconditions.checkNotNull(address, "address");

    this.getBanList(Type.IP).addBan(address, null, null, null);
}
 
开发者ID:CanaryBukkitTeam,项目名称:CanaryBukkit,代码行数:6,代码来源:CanaryServer.java


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