use of net.minecraft.server.v1_9_R2.AttributeInstance in project NoCheatPlus by NoCheatPlus.
the class AttributeAccess method getSpeedAttributeMultiplier.
@Override
public double getSpeedAttributeMultiplier(Player player) {
final AttributeInstance attr = ((CraftLivingEntity) player).getHandle().getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
final double val = attr.getValue() / attr.b();
final AttributeModifier mod = attr.a(AttribUtil.ID_SPRINT_BOOST);
if (mod == null) {
return val;
} else {
return val / AttribUtil.getMultiplier(mod.c(), mod.d());
}
}
Aggregations