本文整理汇总了Java中net.minecraft.util.ChunkCoordinates.getDistanceSquaredToChunkCoordinates方法的典型用法代码示例。如果您正苦于以下问题:Java ChunkCoordinates.getDistanceSquaredToChunkCoordinates方法的具体用法?Java ChunkCoordinates.getDistanceSquaredToChunkCoordinates怎么用?Java ChunkCoordinates.getDistanceSquaredToChunkCoordinates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.ChunkCoordinates
的用法示例。
在下文中一共展示了ChunkCoordinates.getDistanceSquaredToChunkCoordinates方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findPlayers
import net.minecraft.util.ChunkCoordinates; //导入方法依赖的package包/类
/**
* Find all players in a specified range and narrowing down by other parameters
*/
public List findPlayers(ChunkCoordinates par1ChunkCoordinates, int par2, int par3, int par4, int par5, int par6, int par7, Map par8Map, String par9Str, String par10Str, World par11World)
{
if (this.playerEntityList.isEmpty())
{
return null;
}
else
{
Object var12 = new ArrayList();
boolean var13 = par4 < 0;
boolean var14 = par9Str != null && par9Str.startsWith("!");
boolean var15 = par10Str != null && par10Str.startsWith("!");
int var16 = par2 * par2;
int var17 = par3 * par3;
par4 = MathHelper.abs_int(par4);
if (var14)
{
par9Str = par9Str.substring(1);
}
if (var15)
{
par10Str = par10Str.substring(1);
}
for (int var18 = 0; var18 < this.playerEntityList.size(); ++var18)
{
EntityPlayerMP var19 = (EntityPlayerMP)this.playerEntityList.get(var18);
if ((par11World == null || var19.worldObj == par11World) && (par9Str == null || var14 != par9Str.equalsIgnoreCase(var19.getCommandSenderName())))
{
if (par10Str != null)
{
Team var20 = var19.getTeam();
String var21 = var20 == null ? "" : var20.getRegisteredName();
if (var15 == par10Str.equalsIgnoreCase(var21))
{
continue;
}
}
if (par1ChunkCoordinates != null && (par2 > 0 || par3 > 0))
{
float var22 = par1ChunkCoordinates.getDistanceSquaredToChunkCoordinates(var19.getPlayerCoordinates());
if (par2 > 0 && var22 < (float)var16 || par3 > 0 && var22 > (float)var17)
{
continue;
}
}
if (this.func_96457_a(var19, par8Map) && (par5 == WorldSettings.GameType.NOT_SET.getID() || par5 == var19.theItemInWorldManager.getGameType().getID()) && (par6 <= 0 || var19.experienceLevel >= par6) && var19.experienceLevel <= par7)
{
((List)var12).add(var19);
}
}
}
if (par1ChunkCoordinates != null)
{
Collections.sort((List)var12, new PlayerPositionComparator(par1ChunkCoordinates));
}
if (var13)
{
Collections.reverse((List)var12);
}
if (par4 > 0)
{
var12 = ((List)var12).subList(0, Math.min(par4, ((List)var12).size()));
}
return (List)var12;
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:82,代码来源:ServerConfigurationManager.java