
net.minecraft.server.ScoreboardHealthCriteria Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walk-server Show documentation
Show all versions of walk-server Show documentation
A spigot fork to kotlin structure and news.
package net.minecraft.server;
import java.util.Iterator;
import java.util.List;
public class ScoreboardHealthCriteria extends ScoreboardBaseCriteria {
public ScoreboardHealthCriteria(String s) {
super(s);
}
public int getScoreModifier(List list) {
float f = 0.0F;
EntityHuman entityhuman;
for (Iterator iterator = list.iterator(); iterator.hasNext(); f += entityhuman.getHealth() + entityhuman.getAbsorptionHearts()) {
entityhuman = (EntityHuman) iterator.next();
}
if (list.size() > 0) {
f /= (float) list.size();
}
return MathHelper.f(f);
}
public boolean isReadOnly() {
return true;
}
public EnumScoreboardHealthDisplay c() {
return EnumScoreboardHealthDisplay.HEARTS;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy