protected virtual void CheckValueType(Object value, Type type) { if(!type.IsInstanceOfType(value)) { throw new NMSException("Expected type: " + type.Name + " but was: " + value); } }