We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
public EntityLivingBase getTarget() { double x = Minecraft.getMinecraft().thePlayer.posX; double y = Minecraft.getMinecraft().thePlayer.posY; double z = Minecraft.getMinecraft().thePlayer.posZ; int bound = 500; List entityList = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(x - (bound / 2d), y - (256 / 2d), z - (bound / 2d), x + (bound / 2d), y + (256 / 2d), z + (bound / 2d)), null); if (!entityList.isEmpty()) { EntityLivingBase[] Array = entityList.toArray(new EntityLivingBase[0]); for (int i = 0; i < Array.length; i++) { EntityLivingBase insertValue=Array[i]; int insertIndex=i-1; while (insertIndex>=0 && insertValue.getPositionVector().distanceTo(Minecraft.getMinecraft().thePlayer.getPositionVector()) < Array[insertIndex].getPositionVector().distanceTo(Minecraft.getMinecraft().thePlayer.getPositionVector())) { Array[insertIndex+1]=Array[insertIndex]; insertIndex--; } Array[insertIndex+1]=insertValue; } for(EntityLivingBase entity : Array){ if(isValid(entity)){ return entity; } } } return null; }
这合理吗
The text was updated successfully, but these errors were encountered:
本项目已经停止维护 如有疑问/修改意见 建议直接发PR——ISS.jpg
Sorry, something went wrong.
我不清楚 lol
No branches or pull requests
public EntityLivingBase getTarget() {
double x = Minecraft.getMinecraft().thePlayer.posX;
double y = Minecraft.getMinecraft().thePlayer.posY;
double z = Minecraft.getMinecraft().thePlayer.posZ;
int bound = 500;
List entityList = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(x - (bound / 2d), y - (256 / 2d), z - (bound / 2d), x + (bound / 2d), y + (256 / 2d), z + (bound / 2d)), null);
if (!entityList.isEmpty()) {
EntityLivingBase[] Array = entityList.toArray(new EntityLivingBase[0]);
for (int i = 0; i < Array.length; i++) {
EntityLivingBase insertValue=Array[i];
int insertIndex=i-1;
while (insertIndex>=0 && insertValue.getPositionVector().distanceTo(Minecraft.getMinecraft().thePlayer.getPositionVector()) < Array[insertIndex].getPositionVector().distanceTo(Minecraft.getMinecraft().thePlayer.getPositionVector())) {
Array[insertIndex+1]=Array[insertIndex];
insertIndex--;
}
Array[insertIndex+1]=insertValue;
}
for(EntityLivingBase entity : Array){
if(isValid(entity)){
return entity;
}
}
}
return null;
}
这合理吗
The text was updated successfully, but these errors were encountered: